Hi,
Thanks for the v4 series. I looked at it and ran it.
Applied: v4-0001..0003 apply cleanly with git am on master 9a84976.
The build (without ICU) succeeded.
Tested:
- "make check": passes.
- "make -C src/bin/pg_combinebackup check" (including the new
015_summary_past_switch.pl and 016_truncation_after_target.pl) and
"make -C src/bin/pg_walsummary check" (including
004_promote_past_target.pl): all pass.
- The new tests against unpatched master: on master 9a84976 with only
the test files from the series copied in (no changes to the C code),
all three fail:
- t/016_truncation_after_target.pl: the standby hits "TRAP: failed
Assert("end_of_summary_lsn >= current_lsn"), File: "walsummarizer.c",
Line: 455" and the test dies waiting for promotion.
- t/015_summary_past_switch.pl: "Failed test 'standby1: the
summarizer does not read past replay'" (got 'f', expected 't').
- t/004_promote_past_target.pl: "Failed test 'the summarizer does
not read past replay'" (got 'f', expected 't').
With v4-0001..0003 applied, the same three tests pass. So the tests
do catch the problem on unpatched master.
I also tried a manual run (primary and standby with
recovery_target_lsn and recovery_target_action=promote,
summarize_wal=on, extra WAL after the target, then promotion, full
plus incremental backup and pg_combinebackup). It looked fine with the
series, but gave identical output on unpatched master, so I did not
manage to reproduce the race outside the TAP tests.
Two small nits (confirmed in the patches):
1. The commit message of 0003 mentions t/014_summary_past_switch.pl
and t/015_truncation_after_target.pl, but the files are
015_summary_past_switch.pl and 016_truncation_after_target.pl.
2. The header comment of t/016_truncation_after_target.pl still says
"A standby can summarize WAL past its recovery target", which no
longer matches what 0003 does.
Not tested: backpatching to 17/18, meson builds, Windows, an old
on-disk summary that crosses a switch point (the 0002 check) outside
the TAP test, and builds with ICU.
Thanks again,
João Rito