Re: Hot Standby: missing snapshot conflicts in CREATE INDEX, rewrite, hash

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Michael Malis <malis(at)pgrust(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Hot Standby: missing snapshot conflicts in CREATE INDEX, rewrite, hash
Date: 2026-12-02 00:55:34
Message-ID: CAGRkXqQk=DXKyhFW9piKN=7hL5UdVrxagxfO+zjE-DwRAx0a7Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Michael,

Thanks for the report and the test, I can reproduce all three cases on
master.

0001 stops hash splits and squeezes from dropping LP_DEAD
tuples.
0002 adds a WAL record that raises a snapshot conflict for
index builds and rewrites.
0003 does that for CREATE INDEX CONCURRENTLY too, which loses
rows even with hot_standby_feedback on. It makes REINDEX CONCURRENTLY
of a cached table 10% slower.

With max_standby_streaming_delay = -1 a standby query waiting for the
lock on a rewritten table can now block replay until it is canceled.

An older standby can't replay a new record, so on the back branches I
would reuse XLOG_BTREE_REUSE_PAGE as in the nocfbot file. What
do you think?

Thanks,
Shihao

Attachment Content-Type Size
v1-0001-Keep-LP_DEAD-tuples-in-hash-bucket-splits-and-squ.patch application/octet-stream 3.2 KB
v1-0003-Log-a-snapshot-conflict-for-concurrent-index-buil.patch application/octet-stream 6.5 KB
v1-0002-Log-a-snapshot-conflict-for-index-builds-and-tabl.patch application/octet-stream 10.5 KB
nocfbot-v1-REL_18-0002-rebuild-conflict.patch application/octet-stream 5.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-12-02 01:40:00 RE: BUG #18754: Logical replication cannot restart if client sent a copyDone
Previous Message Zsolt Parragi 2026-12-01 21:52:33 Re: BUG #19928: pg_upgrade fails on v18 schema with NOT NULL ... NO INHERIT and inheritance