RE: BUG: Former primary node might stuck when started as a standby

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Michael Paquier' <michael@paquier.xyz>
Cc: Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>, Aleksander Alekseev <aleksander@timescale.com>
Date: 2026-03-03T08:14:28Z
Lists: pgsql-hackers

Attachments

Dear Michael,

> Requiring injection points to be enabled so as we have a strict
> control over the standby snapshot records does not strike me as a bad
> requirement in itself.  Most of the animals use the switch these days.
> It's a bit sad if this is not entirely stable in pre-v16 branches, but
> a stable post-v17 behavior would always be better than an unstable
> behavior everywhere.

OK, thanks for the clarification. I will create patches for back branches
after it is stabilized on HEAD.
(Current one might be able to be applied, not sure)

> +	autovacuum = off
> +	checkpoint_timeout = 1h
> 
> Why do we need these?  An explanation seems in order in the shape of a
> commit, or these should be removed.

I think it is needed to stabilize the test. If checkpointer and/or may generate
the WAL between the switchover, the test can fail with the same reason as bgwriter's
activity. I added comments for it.

> Is there a different trick than the one posted at [1] to check the
> stability of the proposal?  I am wondering if I am missing something,
> or if that's all.  Alexander?
> 
> [1]:
> https://www.postgresql.org/message-id/e1cf52d2-c344-4dfd-a918-e5f20ff04fa
> 2@gmail.com

To clarify, I have no knowledge for it.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

  1. Fix rare instability in recovery TAP test 004_timeline_switch

  2. Fix rare instability in recovery TAP test 009_twophase