Re: Resetting recovery target parameters in pg_createsubscriber

Alena Vinter <dlaaren8@gmail.com>

From: Alena Vinter <dlaaren8@gmail.com>
To: Ilyasov Ian <ianilyasov@outlook.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-10-06T06:25:12Z
Lists: pgsql-hackers

Attachments

Hi everyone,

Thank you for all the valuable feedback! I've improved the patches in the
latest version.


> Based on the contents of the latest patch, we reset the parameters
> after promoting the node, and primary_conninfo only matters while we
> are in recovery, for a standby recovery WAL using the streaming
> replication protocol.

Michael, thanks for helping! This fact simplifies the code. I put resetting
the parameters exclusively in the `atexit` callback -- this approach seems
neater to me. What do you think?


> Did I get the idea right?

Ian, yes, you got it right. The core issue occurs when postgres encounters
a checkpoint during recovery, determines redo isn't needed (because there
are no records after the checkpoint), but then fails with a fatal error
because it cannot reach the specified LSN target (which is lower than the
checkpoint LSN). I reckon this is a recovery logic issue, but I also
believe the component that sets recovery parameters should be responsible
for cleaning them up when they're no longer required.


Best wishes,
Alena Vinter