Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks
JoongHyuk Shin <sjh910805@gmail.com>
From: JoongHyuk Shin <sjh910805@gmail.com>
To: assam258@gmail.com
Cc: Álvaro Herrera <alvherre@kurilemu.de>, Scott Ray <scott@scottray.io>, Fujii Masao <masao.fujii@gmail.com>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers@lists.postgresql.org
Date: 2026-06-29T04:45:37Z
Lists: pgsql-hackers
Attachments
- v7-0001-Don-t-call-ereport-ERROR-from-recovery-target-GUC.patch (application/octet-stream) patch v7-0001
Thanks for the reviews. v7 attached, reworked along the lines discussed. The assign hooks no longer touch recoveryTarget; each just stores its own value, and recoveryTarget is derived once in validateRecoveryParameters() from the settled recovery_target* settings, which also rejects setting more than one target. The v6 review comments are folded in too. > recovery_target_xid=700 is silently ignored ... target overshoot > derive recoveryTarget from the settled GUC strings Done that way. A new test, standby_clobber_clear, sets a competing target and clears it again; on master that is rejected outright, while here recovery stops at the xid. I left out the extra boolean. recovery_target's own string is "immediate" or empty, so immediate is detected like the other four. Deriving it from the typed value variables would need the flag, but those aren't reliable "is set" signals anyway, since the time value is parsed late and an LSN of 0/0 is valid. Happy to add it back if you prefer it explicit. > the legacy extra parentheses in ereport() Dropped. -- JH Shin