Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4a6603c

Browse files
Fix assertion failure in heap_vacuum_rel
Commit 7d71d3d changed resetting the VacuumFailsafeActive flag to an assertion since the flag is reset before starting vacuuming a relation. This however failed to take recursive calls of vacuum_rel() and vacuum of TOAST tables into consideration. Fix by reverting back to resettting the flag. Author: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reported-by: John Naylor <john.naylor@enterprisedb.com> Discussion: https://postgr.es/m/CAFBsxsFz=GqaG5Ens5aNgVYoV2Y+pfMUijX0ku+CCkWfALwiqg@mail.gmail.com
1 parent b72f564 commit 4a6603c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/access/heap/vacuumlazy.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,11 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
389389
Assert(params->index_cleanup != VACOPTVALUE_UNSPECIFIED);
390390
Assert(params->truncate != VACOPTVALUE_UNSPECIFIED &&
391391
params->truncate != VACOPTVALUE_AUTO);
392-
Assert(!VacuumFailsafeActive);
392+
/*
393+
* While VacuumFailSafeActive is reset to false before calling this, we
394+
* still need to reset it here due to recursive calls.
395+
*/
396+
VacuumFailsafeActive = false;
393397
vacrel->consider_bypass_optimization = true;
394398
vacrel->do_index_vacuuming = true;
395399
vacrel->do_index_cleanup = true;

0 commit comments

Comments
 (0)