Commit e8f201ab authored by Peter Geoghegan's avatar Peter Geoghegan

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 c242baa4, 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().
parent 96795176
...@@ -1162,7 +1162,8 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive) ...@@ -1162,7 +1162,8 @@ lazy_scan_heap(LVRelState *vacrel, VacuumParams *params, bool aggressive)
* There is a similar check inside lazy_vacuum_all_indexes(), but * There is a similar check inside lazy_vacuum_all_indexes(), but
* relfrozenxid might start to look dangerously old before we reach * relfrozenxid might start to look dangerously old before we reach
* that point. This check also provides failsafe coverage for the * that point. This check also provides failsafe coverage for the
* one-pass strategy case. * one-pass strategy, and the two-pass strategy with the index_cleanup
* param set to 'off'.
*/ */
if (blkno - next_failsafe_block >= FAILSAFE_EVERY_PAGES) if (blkno - next_failsafe_block >= FAILSAFE_EVERY_PAGES)
{ {
...@@ -2611,9 +2612,6 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel) ...@@ -2611,9 +2612,6 @@ lazy_check_wraparound_failsafe(LVRelState *vacrel)
if (unlikely(vacuum_xid_failsafe_check(vacrel->relfrozenxid, if (unlikely(vacuum_xid_failsafe_check(vacrel->relfrozenxid,
vacrel->relminmxid))) vacrel->relminmxid)))
{ {
Assert(vacrel->do_index_vacuuming);
Assert(vacrel->do_index_cleanup);
vacrel->failsafe_active = true; vacrel->failsafe_active = true;
/* Disable index vacuuming, index cleanup, and heap rel truncation */ /* Disable index vacuuming, index cleanup, and heap rel truncation */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment