]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Repair VACUUM FULL bug introduced by HOT patch: the original way of
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Feb 2008 19:15:00 +0000 (19:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Feb 2008 19:15:00 +0000 (19:15 +0000)
commitbb4b179b5e80b66c4049226f8dc2966bd1ce50aa
treee7f98b3646740abd908c54311c4f9859fd473d69
parentd85096ce12965d5b642d524b3b930caa0e932dec
Repair VACUUM FULL bug introduced by HOT patch: the original way of
calculating a page's initial free space was fine, and should not have been
"improved" by letting PageGetHeapFreeSpace do it.  VACUUM FULL is going to
reclaim LP_DEAD line pointers later, so there is no need for a guard
against the page being too full of line pointers, and having one risks
rejecting pages that are perfectly good move destinations.

This also exposed a second bug, which is that the empty_end_pages logic
assumed that any page with no live tuples would get entered into the
fraged_pages list automatically (by virtue of having more free space than
the threshold in the do_frag calculation).  This assumption certainly
seems risky when a low fillfactor has been chosen, and even without
tunable fillfactor I think it could conceivably fail on a page with many
unused line pointers.  So fix the code to force do_frag true when notup
is true, and patch this part of the fix all the way back.

Per report from Tomas Szepe.
src/backend/commands/vacuum.c