Another option might be to just force initial reply/feedback messages when streaming starts. The attached patch improves src/test/recovery test runtime just like the previous one I posted.
On Mon, Nov 14, 2022 at 11:01:27AM -0800, Nathan Bossart wrote: > I wonder if we > ought to do something similar in the ConfigReloadPending path in case > hot_standby_feedback is being turned on. Looking closer, I see that a feedback message is forced in this case already. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 8bd2ba37dd..ad383dbcaa 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -433,6 +433,10 @@ WalReceiverMain(void) for (int i = 0; i < NUM_WALRCV_WAKEUPS; ++i) WalRcvComputeNextWakeup(i, now); + /* Send initial reply/feedback messages. */ + XLogWalRcvSendReply(true, false); + XLogWalRcvSendHSFeedback(true); + /* Loop until end-of-streaming or error */ for (;;) {