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

Commitfbe9b80

Browse files
Fix autovacuum log output heap truncation issue.
The percentage of blocks from the table value reported by autovacuum logoutput (following commit5100010) should never exceed 100% becauseit describes the state of the table back when lazy_vacuum() was called.The value could nevertheless exceed 100% in the event of heap relationtruncation. We failed to compensate for how truncation affectsrel_pages.Fix the faulty accounting by using the original rel_pages value insteadof the current/final rel_pages value.Reported-By: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20210423204306.5osfpkt2ggaedyvy@alap3.anarazel.de
1 parentb2d0c7c commitfbe9b80

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/backend/access/heap/vacuumlazy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,8 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
777777
(long long)VacuumPageDirty);
778778
if (vacrel->rel_pages>0)
779779
{
780+
BlockNumberorig_rel_pages;
781+
780782
if (vacrel->do_index_vacuuming)
781783
{
782784
msgfmt=_(" %u pages from table (%.2f%% of total) had %lld dead item identifiers removed\n");
@@ -795,9 +797,10 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
795797
else
796798
appendStringInfo(&buf,_("index scan bypassed by failsafe:"));
797799
}
800+
orig_rel_pages=vacrel->rel_pages+vacrel->pages_removed;
798801
appendStringInfo(&buf,msgfmt,
799802
vacrel->lpdead_item_pages,
800-
100.0*vacrel->lpdead_item_pages /vacrel->rel_pages,
803+
100.0*vacrel->lpdead_item_pages /orig_rel_pages,
801804
(long long)vacrel->lpdead_items);
802805
}
803806
for (inti=0;i<vacrel->nindexes;i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp