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

Commit6265661

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 parentbdd5d41 commit6265661

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

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp