Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc52e0e2

Browse files
Avoid holding vmbuffer pin after VACUUM.
During VACUUM if we pause to perform a cycleof index cleanup we drop the vmbuffer pin,so we should do the same thing when heapscan completes. This avoids holding vmbufferpin across the main index cleanup in VACUUM,which could be minutes or hours longer thannecessary for correctness.Bug report and suggested fix from Pavan Deolasee
1 parent17164cc commitc52e0e2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

‎src/backend/commands/vacuumlazy.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,15 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
831831
vacrelstats->scanned_pages,
832832
num_tuples);
833833

834+
/*
835+
* Release any remaining pin on visibility map page.
836+
*/
837+
if (BufferIsValid(vmbuffer))
838+
{
839+
ReleaseBuffer(vmbuffer);
840+
vmbuffer=InvalidBuffer;
841+
}
842+
834843
/* If any tuples need to be deleted, perform final vacuum cycle */
835844
/* XXX put a threshold on min number of tuples here? */
836845
if (vacrelstats->num_dead_tuples>0)
@@ -848,13 +857,6 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
848857
vacrelstats->num_index_scans++;
849858
}
850859

851-
/* Release the pin on the visibility map page */
852-
if (BufferIsValid(vmbuffer))
853-
{
854-
ReleaseBuffer(vmbuffer);
855-
vmbuffer=InvalidBuffer;
856-
}
857-
858860
/* Do post-vacuum cleanup and statistics update for each index */
859861
for (i=0;i<nindexes;i++)
860862
lazy_cleanup_index(Irel[i],indstats[i],vacrelstats);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp