Skip to content

Commit e8f201a

Browse files
Remove overzealous VACUUM failsafe assertions.
The failsafe can trigger when index processing is already disabled. This can happen when VACUUM's INDEX_CLEANUP parameter is "off" and the failsafe happens to trigger. Remove assertions that assume that index processing is directly tied to the failsafe. Oversight in commit c242baa, which made it possible for the failsafe to trigger in a two-pass strategy VACUUM that has yet to make its first call to lazy_vacuum_all_indexes().
1 parent 9679517 commit e8f201a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,8 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
11621162
* There is a similar check inside lazy_vacuum_all_indexes(), but
11631163
* relfrozenxid might start to look dangerously old before we reach
11641164
* that point. This check also provides failsafe coverage for the
1165-
* one-pass strategy case.
1165+
* one-pass strategy, and the two-pass strategy with the index_cleanup
1166+
* param set to 'off'.
11661167
*/
11671168
if (blkno - next_failsafe_block >= FAILSAFE_EVERY_PAGES)
11681169
{
@@ -2611,9 +2612,6 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel)
26112612
if (unlikely(vacuum_xid_failsafe_check(vacrel->relfrozenxid,
26122613
vacrel->relminmxid)))
26132614
{
2614-
Assert(vacrel->do_index_vacuuming);
2615-
Assert(vacrel->do_index_cleanup);
2616-
26172615
vacrel->failsafe_active = true;
26182616

26192617
/* Disable index vacuuming, index cleanup, and heap rel truncation */

0 commit comments

Comments
 (0)