Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae
Melanie Plageman <melanieplageman@gmail.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Ensure vacuum removes all visibly dead tuples older than OldestXmin
- 06bf404cd07b 16.4 landed
- 45ce054c02b8 14.13 landed
- dc6354c67017 15.8 landed
-
Combine freezing and pruning steps in VACUUM
- 6dbb490261a6 17.0 cited
-
Handle non-chain tuples outside of heap_prune_chain()
- 6f47f6883151 17.0 cited
-
Fix false reports in pg_visibility
- e85662df44ff 17.0 cited
-
Remove retry loop in heap_page_prune().
- 1ccc1e05ae8f 17.0 cited
-
vacuumlazy.c: document vistest and OldestXmin.
- 73f6ec3d3c8d 15.0 cited
-
Deduplicate choice of horizon for a relation procarray.c.
- d9d8aa9bb9aa 15.0 cited
-
Remove tupgone special case from vacuumlazy.c.
- 8523492d4e34 14.0 cited
-
Simplify state managed by VACUUM.
- b4af70cb2103 14.0 cited
-
Recycle nbtree pages deleted during same VACUUM.
- 9dd963ae2534 14.0 cited
-
snapshot scalability: Don't compute global horizons while building snapshots.
- dc7420c2c927 14.0 cited
-
Raise error when affecting tuple moved into different partition.
- f16241bef7cc 11.0 cited
On Thu, Jun 20, 2024 at 11:49 AM Melanie Plageman <melanieplageman@gmail.com> wrote: > > On Tue, Jun 18, 2024 at 6:51 PM Melanie Plageman > <melanieplageman@gmail.com> wrote: > > > > Finally, upthread there is discussion of how we could end up doing a > > catalog lookup after vacuum_get_cutoffs() and before the tuple > > visibility check on 16. Assuming this is true, we would want to > > backport the fix to 16 as well. I could use some help getting a repro > > (using btree index deletion for example) of the infinite loop on 16. > > So, I ended up working on a new repro that works by forcing a round of > index vacuuming after the standby reconnects and before pruning a dead > tuple whose xmax is older than OldestXmin. > > At the end of the round of index vacuuming, _bt_pendingfsm_finalize() > calls GetOldestNonRemovableTransactionId(), thereby updating the > backend's GlobalVisState and moving maybe_needed backwards. > > Then vacuum's first pass will continue with pruning and find our later > inserted and updated tuple HEAPTUPLE_RECENTLY_DEAD when compared to > maybe_needed but HEAPTUPLE_DEAD when compared to OldestXmin. > > I make sure that the standby reconnects between vacuum_get_cutoffs() > (vacuum_set_xid_limits() on 14/15) and pruning because I have a cursor > on the page keeping VACUUM FREEZE from getting a cleanup lock. > > See the repros for step-by-step explanations of how it works. > > With this, I can repro the infinite loop on 14-16. > > Backporting 1ccc1e05ae fixes 16 but, with the new repro, 14 and 15 > error out with "cannot freeze committed xmax". I'm going to > investigate further why this is happening. It definitely makes me > wonder about the fix. It turns out it was also erroring out on 16 (i.e. backporting 1ccc1e05ae did not fix anything), but I didn't notice it because the perl TAP test passed. I also discovered we can hit this error in master, so I started a thread about that here [1]. - Melanie [1] https://www.postgresql.org/message-id/CAAKRu_bDD7oq9ZwB2OJqub5BovMG6UjEYsoK2LVttadjEqyRGg%40mail.gmail.com