Re: Resetting recovery target parameters in pg_createsubscriber - Mailing list pgsql-hackers

From Alena Vinter
Subject Re: Resetting recovery target parameters in pg_createsubscriber
Date
Msg-id CAGWv16LPtKym0kBW-hsYe7XMm9j1+1ap0jga+QarW4Ku1oV13g@mail.gmail.com
Whole thread Raw
In response to RE: Resetting recovery target parameters in pg_createsubscriber  (Ilyasov Ian <ianilyasov@outlook.com>)
List pgsql-hackers
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
Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: Michael Paquier
Date:
Subject: Re: Add stats_reset to pg_stat_all_tables|indexes and related views