mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
Fix broken logic in lazy_vacuum_heap.
As noted by Tom Lane, the previous coding in this area, which I
introduced in commit bbb6e559c4
, was
poorly tested and caused the vacuum's second heap to go into what would
have been an infinite loop but for the fact that it eventually caused a
memory allocation failure. This version seems to work better.
This commit is contained in:
parent
4d0b11a0ca
commit
d0dcb315db
@ -991,7 +991,11 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats)
|
|||||||
buf = ReadBufferExtended(onerel, MAIN_FORKNUM, tblk, RBM_NORMAL,
|
buf = ReadBufferExtended(onerel, MAIN_FORKNUM, tblk, RBM_NORMAL,
|
||||||
vac_strategy);
|
vac_strategy);
|
||||||
if (!ConditionalLockBufferForCleanup(buf))
|
if (!ConditionalLockBufferForCleanup(buf))
|
||||||
|
{
|
||||||
|
ReleaseBuffer(buf);
|
||||||
|
++tupindex;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
tupindex = lazy_vacuum_page(onerel, tblk, buf, tupindex, vacrelstats);
|
tupindex = lazy_vacuum_page(onerel, tblk, buf, tupindex, vacrelstats);
|
||||||
|
|
||||||
/* Now that we've compacted the page, record its available space */
|
/* Now that we've compacted the page, record its available space */
|
||||||
|
Loading…
Reference in New Issue
Block a user