Re: BUG #19897: Recovery fails after "LOG: consistent recovery state reached"

From: surya poondla <suryapoondla4(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, srinath2133(at)gmail(dot)com
Subject: Re: BUG #19897: Recovery fails after "LOG: consistent recovery state reached"
Date: 2026-12-01 01:00:27
Message-ID: CAOVWO5pwsUbN7ckUD+NaeNQ=P6oCmPQuhQv0ODhWT7+wovZhPg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Zsolt, Kyotaro, Srinath

Srinath pointed me here from [1], where I was reviewing his patch.

I tried both Kyotaro's v3 and Zsolt's v4 on master with
recovery_target = 'immediate', a backup taken from a standby, a
crashed cluster, and a cleanly shut down one, each also with standby.signal.

Both fix the reported case and the crashed cluster. But with Kyotaro's v3
the cleanly shut down cluster still fails:

LOG: redo is not required
FATAL: recovery ended before configured recovery target was reached

The new check only runs after the redo loop, and with nothing to replay we
never get there. Srinath's patch from [1] on top of v3
fixes it (might need a git am -3, context only), so +1 to adding it.

On the standby mode part, with no primary_conninfo v4 stops waiting
for WAL by itself once it's consistent. With v3 the crashed and clean
clusters keep waiting as on master, but can now be promoted (the clean
one only with Srinath's patch). Both avoid the FATAL, so keeping that
as a separate patch makes sense to me.

Haruka's earlier failure in 003_recovery_targets.pl looks fixed: an
unreachable recovery_target_name still fails as expected with both v4
and Kyotaro's v3, and that test passes.

One thing in Kyotaro's 0001 test is it timed out in setup for me. The
standby is created from my_backup with streaming only, and the
CHECKPOINT on the primary right after it recycles a segment the
standby still needs ("requested WAL segment
000000010000000000000004 has already been removed"). Waiting for
catchup before the CHECKPOINT, or using has_restoring, should fix it.

[1]
https://postgr.es/m/CAFC%2Bb6q2rubdCpku9cH_D5k3cMP8m1TPmCkLRnqMibfBr16SSA%40mail.gmail.com

Regards,
Surya Poondla

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message ZhangChi 2026-12-01 01:02:58 Re: BUG #19944: Memoize caches volatile LATERAL scans across RTE_FUNCTION and RTE_VALUES, returning wrong results
Previous Message Tom Lane 2026-12-01 00:59:37 Re: BUG #19911: Window aggregate over ROWS n FOLLOWING: "unexpected end of tuplestore" after spill