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

Commit758bd2a

Browse files
Respect Hot Standby controls while recycling btree index pages.
Btree pages were recycled after VACUUM deletes all records on apage and then a subsequent VACUUM occurs after the RecentXminhorizon is reached. Using RecentXmin meant that we did not respondcorrectly to the user controls provide to avoid Hot Standbyconflicts and so spurious conflicts could be generated in someworkload combinations. We now reuse pages only when we reachRecentGlobalXmin, which can be much later in the presence of longrunning queries and is also controlled by vacuum_defer_cleanup_ageand hot_standby_feedback.Noah Misch and Simon Riggs
1 parent1568fa7 commit758bd2a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/backend/access/nbtree/nbtpage.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ bool
677677
_bt_page_recyclable(Pagepage)
678678
{
679679
BTPageOpaqueopaque;
680+
TransactionIdcutoff;
680681

681682
/*
682683
* It's possible to find an all-zeroes page in an index --- for example, a
@@ -689,11 +690,18 @@ _bt_page_recyclable(Page page)
689690

690691
/*
691692
* Otherwise, recycle if deleted and too old to have any processes
692-
* interested in it.
693+
* interested in it. If we are generating records for Hot Standby
694+
* defer page recycling until RecentGlobalXmin to respect user
695+
* controls specified by vacuum_defer_cleanup_age or hot_standby_feedback.
693696
*/
697+
if (XLogStandbyInfoActive())
698+
cutoff=RecentGlobalXmin;
699+
else
700+
cutoff=RecentXmin;
701+
694702
opaque= (BTPageOpaque)PageGetSpecialPointer(page);
695703
if (P_ISDELETED(opaque)&&
696-
TransactionIdPrecedesOrEquals(opaque->btpo.xact,RecentXmin))
704+
TransactionIdPrecedesOrEquals(opaque->btpo.xact,cutoff))
697705
return true;
698706
return false;
699707
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp