Re: Resetting recovery target parameters in pg_createsubscriber

From: Alena Vinter <dlaaren8(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Resetting recovery target parameters in pg_createsubscriber
Date: 2025-09-23 05:04:04
Message-ID: CAGWv16KC2RGC30GtpWQc+7yuhr6bnOz7qypb=DGFGQ23C6ARSQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm back with improvements :)
I've added code comments in `recovery_gen.c` and expanded the documentation
in `pg_createsubscriber.sgml`.

About the recovery parameters cleanup: I thought about adding an exit
callback, but it doesn't really make sense because once the target server
gets promoted (which happens soon after we set the parameters), there's no
point in cleaning up - the server is already promoted and can't be used as
a replica again and must be recreated. Also, `reset_recovery_params()`
might call `exit()` itself, which could cause problems with the cleanup
callback.
So I think it's better to just warn users about leftover parameters and let
them handle the cleanup manually if needed.

By the way, is it ok that the second patch includes both code and test
changes together, or should I split them into separate commits?

I look forward to your feedback!

Regards,
Alena Vinter

Attachment Content-Type Size
v5-0002-Reseting-recovery-target-parameters-in-pg_createsubscriber.patch text/x-patch 6.4 KB
v5-0001-Implements-helper-function-in-recovery_gen.patch text/x-patch 4.2 KB
v5-0003-doc-Add-warning-about-leftover-recovery-parameters-in-pg_createsubscriber.patch text/x-patch 1.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-09-23 05:37:44 Re: let ALTER TABLE DROP COLUMN drop whole-row referenced object
Previous Message Tom Lane 2025-09-23 05:02:20 Re: [PATCH] Introduce unified support for composite GUC options