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

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, Aleksander Alekseev <aleksander@timescale.com>
Date: 2026-02-12T19:00:00Z
Lists: pgsql-hackers

Attachments

Dear Kuroda-san,

09.02.2026 04:38, Hayato Kuroda (Fujitsu) wrote:
>
> Dear Alexander, Aleksander
>
> Is it enough that we can wait till all WALs are replayed before the promotion?
>
> Like attached.
>
>

Thank you for paying attention to this!

I tried to add
$primary->wait_for_replay_catchup($standby);
in my test (see attached), but that doesn't help -- it still fails as below:
iteration 61
# +++ tap check in src/test/recovery +++
t/099_change_roles.pl .. 1/? make: *** [Makefile:28: check] Terminated

src/test/recovery/tmp_check/log/099_change_roles_node1.log
2026-02-12 20:30:42.953 EET [2716149] LOG:  new timeline 4 forked off current database system timeline 3 before current 
recovery point 0/3025B48

Best regards,
Alexander

Commits

  1. Fix rare instability in recovery TAP test 004_timeline_switch

  2. Fix rare instability in recovery TAP test 009_twophase