Re: Unnecessary delay in streaming replication due to replay lag

From: Huansong Fu <huansong(dot)fu(dot)info(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Sunil S <sunilfeb26(at)gmail(dot)com>
Subject: Re: Unnecessary delay in streaming replication due to replay lag
Date: 2025-07-28 22:41:24
Message-ID: 175374248473.990.8072449260770178398.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: tested, failed
Spec compliant: not tested
Documentation: not tested

Hi,

I've been playing with the patch. It worked as intended. I have a few minor review comments on the code and test:

1. There was some indent issue when applying the v6-0001 patch:
v6-0001-Introduce-feature-to-start-WAL-receiver-eagerly.patch:342: space before tab in indent.
gettext_noop("When to start WAL receiver."),
v6-0001-Introduce-feature-to-start-WAL-receiver-eagerly.patch:343: space before tab in indent.
NULL,
warning: 2 lines add whitespace errors.

2. There was a whitespace issue when applying the v6-0002 test patch:
v6-0002-Test-WAL-receiver-early-start-upon-reaching-consi.patch:126: new blank line at EOF.
+
warning: 1 line adds whitespace errors.

3. Test number for "046_walreciver_start.pl" collided with a recently added test "046_checkpoint_logical_slot.pl" so needs another number.

4. Some text needs wraparound:
* Archiving from the restore command does not holds the control lock
- * and enabling XLogCtl->InstallXLogFileSegmentActive for wal reciever early start
- * will create a race condition with the checkpointer process as fixed in cc2c7d65fc27e877c9f407587b0b92d46cd6dd16.
- * Hence skipping early start of the wal receiver in case of archive recovery.
+ * and enabling XLogCtl->InstallXLogFileSegmentActive for wal reciever
+ * early start will create a race condition with the checkpointer process
+ * as fixed in cc2c7d65fc27e877c9f407587b0b92d46cd6dd16. Hence skipping
+ * early start of the wal receiver in case of archive recovery.
*/

5. Extra ";"
@@ -3820,7 +3821,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
* eagerly).
*/
currentSource = XLOG_FROM_STREAM;
- startWalReceiver = !WalRcvStreaming();;
+ startWalReceiver = !WalRcvStreaming();

Thanks,
Huansong
Broadcom Inc.

The new status of this patch is: Waiting on Author

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Bauman 2025-07-28 23:24:14 Re: Doc update proposal for the note on log_statement in the runtime config for logging page
Previous Message David G. Johnston 2025-07-28 22:38:09 Re: restore_command return code behaviour