Re: New vacuum option to do only freezing
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>,
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>,
"Bossart,
Nathan" <bossartn@amazon.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-04-16T16:01:36Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > On Mon, Apr 15, 2019 at 9:07 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> If we're failing to remove it, and it's below the desired freeze >> horizon, then we'd darn well better freeze it instead, no? > I don't know that that's safe. IIRC, the freeze code doesn't cope > nicely with being given a tuple that actually ought to have been > deleted. It'll just freeze it anyway, which is obviously bad. Looking at heap_prepare_freeze_tuple, it looks to me like it'd notice the problem and throw an error. The two possible reasons for a tuple to be dead are xmin aborted and xmax committed, right? There are tests in there that will complain if either of those is true and the xid is below the freeze horizon. Given that we don't get here except when the tuple has just become dead, it probably is all right to assume that it can't possibly get selected for freezing, and let those tests backstop the assumption. (BTW, I don't understand why that code will throw "found xmin %u from before relfrozenxid %u" if HeapTupleHeaderXminFrozen is true? Shouldn't the whole if-branch at lines 6113ff be skipped if xmin_frozen?) regards, tom lane PS: I see that mandrill just replicated the topminnow failure that started this discussion.
Commits
-
Add toast-level reloption for vacuum_index_cleanup
- ce59b75d449d 12.0 landed
-
heap_prepare_freeze_tuple: Simplify coding
- 2bf372a4ae26 12.0 landed
-
Fix missing word.
- 6665305e17ed 12.0 landed
-
Allow VACUUM to be run with index cleanup disabled.
- a96c41feec6b 12.0 landed
-
Don't mark pages all-visible spuriously
- d2599ecfcc74 11.0 cited