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

Commit17ee02e

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 parent6a8b998 commit17ee02e

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
@@ -947,6 +947,15 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
947947
vacrelstats->scanned_pages,
948948
num_tuples);
949949

950+
/*
951+
* Release any remaining pin on visibility map page.
952+
*/
953+
if (BufferIsValid(vmbuffer))
954+
{
955+
ReleaseBuffer(vmbuffer);
956+
vmbuffer=InvalidBuffer;
957+
}
958+
950959
/* If any tuples need to be deleted, perform final vacuum cycle */
951960
/* XXX put a threshold on min number of tuples here? */
952961
if (vacrelstats->num_dead_tuples>0)
@@ -964,13 +973,6 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
964973
vacrelstats->num_index_scans++;
965974
}
966975

967-
/* Release the pin on the visibility map page */
968-
if (BufferIsValid(vmbuffer))
969-
{
970-
ReleaseBuffer(vmbuffer);
971-
vmbuffer=InvalidBuffer;
972-
}
973-
974976
/* Do post-vacuum cleanup and statistics update for each index */
975977
for (i=0;i<nindexes;i++)
976978
lazy_cleanup_index(Irel[i],indstats[i],vacrelstats);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp