| From: | Raja Sai pranav <rajasaipranav0(at)gmail(dot)com> |
|---|---|
| To: | zsolt(dot)parragi(at)percona(dot)com |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org, zhong950419(at)gmail(dot)com, manuelreyesbravo(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, masao(dot)fujii(at)gmail(dot)com, daria(dot)n(dot)lepikhova(at)gmail(dot)com, ayushtiwari(dot)slg01(at)gmail(dot)com |
| Subject: | Re: Re: Re: Assertion failure in WAL summarizer |
| Date: | 2026-11-16 05:40:30 |
| Message-ID: | CAPHduZAM-wCqoPGwkj=0YBOvmjXQTkbty5JdZ8zz-U9f-2YZ8g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Zsolt,
I reproduced this independently: REL_18_STABLE at 2f613719fa, standby
running the unpatched summarizer, then restarted on 18 + v5. Same result as
yours: the timeline 1 summary is 0/02000028-0/030051F0 (the switch point),
the incremental backup and pg_combinebackup succeed, and the restored table
has 4|0 where the promoted server has 4|1.
As a control, I ran the same steps with v5 on the standby from the start.
The timeline 1 summary has exactly the same range, 0/02000028-0/030051F0,
and the restored table is correct (4|1). So a summary written by the old
summarizer and a correct one can't be told apart by their LSN range, which
means the end_lsn check in 0002 can't catch this case, and changing it to
>= would also refuse correct summaries. The 0003 commit message should
probably not claim that 0002 covers summaries left on disk from before the
update.
Regards,
Sai Pranav
On Mon, Nov 16, 2026 02:53 AM, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
wrote:
> Hello
>
> 0002 misses an old summary that ends exactly at the switch point
>
> The 0003 commit message says that a summary written before a minor
> update "can still be on disk ... and the check added by the previous
> commit still refuses it". That holds for a summary that crosses the
> switch point, but not when the old summarizer was in the middle of a
> summary at promotion time:
>
> * It has already added the records past the target to its block reference
> table
> * then summarizer_read_local_xlog_page() moves read_upto back to the
> switch point
> * SummarizeWAL() hits end of WAL and writes the file as [start, switch
> point], with the truncation from past the target inside it
> * ws->end_lsn == tli_end_lsn, so 0002 doesn't flag it
>
> Reproduction steps:
>
> primary: summarize_wal = on, autovacuum = off
> CREATE TABLE t (id int, v int, pad text STORAGE PLAIN);
> INSERT INTO t SELECT g, 0, repeat('x', 4096) FROM generate_series(1,4) g;
> VACUUM t;
> pg_basebackup -D full -c fast -R
> UPDATE t SET v = 1 WHERE id = 4;
> SELECT pg_current_wal_insert_lsn(); -- recovery_target_lsn for the
> standby
> standby from the same backup: summarize_wal = on,
> recovery_target_action = 'pause', running the old summarizer
> primary: DELETE FROM t WHERE id > 1; VACUUM t;
> wait for the standby to pause and its summarizer to catch up with the
> received WAL
> pg_ctl -m immediate stop the primary, promote the standby
> restart the standby on 18 + v5, pg_basebackup
> --incremental=full/backup_manifest, pg_combinebackup
>
> Result:
>
> 00000002.history: 1 0/030051F0 after LSN 0/03004168
> timeline 1 summary: 0/02000028 - 0/030051F0, limit block 1 for t
> restored rows: 1|0 2|0 3|0 4|0
> promoted server rows: 1|0 2|0 3|0 4|1
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Hayato Kuroda (Fujitsu) | 2026-11-16 05:53:13 | RE: Patch for migration of the pg_commit_ts directory |
| Previous Message | Ayush Tiwari | 2026-11-16 05:26:45 | Re: 041_checkpoint_at_promote.pl might fail due to race condition on child kill |