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

Commit6f1e336

Browse files
committed
Fix bug that could try to freeze running multixacts.
Commits801c2dc and801c2dc made it possible for vacuum totry to freeze a multixact that is still running. That wasprevented by a check, but raised an error. Repair.Back-patch all the way.Author: Nathan Bossart, Jeremy SchneiderReported-by: Jeremy SchneiderReviewed-by: Jim Nasby, Thomas MunroDiscussion:https://postgr.es/m/DAFB8AFF-2F05-4E33-AD7F-FF8B0F760C17%40amazon.com
1 parentd071a25 commit6f1e336

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ vacuum_set_xid_limits(Relation rel,
615615
inteffective_multixact_freeze_max_age;
616616
TransactionIdlimit;
617617
TransactionIdsafeLimit;
618+
MultiXactIdoldestMxact;
618619
MultiXactIdmxactLimit;
619620
MultiXactIdsafeMxactLimit;
620621

@@ -692,7 +693,8 @@ vacuum_set_xid_limits(Relation rel,
692693
Assert(mxid_freezemin >=0);
693694

694695
/* compute the cutoff multi, being careful to generate a valid value */
695-
mxactLimit=GetOldestMultiXactId()-mxid_freezemin;
696+
oldestMxact=GetOldestMultiXactId();
697+
mxactLimit=oldestMxact-mxid_freezemin;
696698
if (mxactLimit<FirstMultiXactId)
697699
mxactLimit=FirstMultiXactId;
698700

@@ -706,7 +708,11 @@ vacuum_set_xid_limits(Relation rel,
706708
ereport(WARNING,
707709
(errmsg("oldest multixact is far in the past"),
708710
errhint("Close open transactions with multixacts soon to avoid wraparound problems.")));
709-
mxactLimit=safeMxactLimit;
711+
/* Use the safe limit, unless an older mxact is still running */
712+
if (MultiXactIdPrecedes(oldestMxact,safeMxactLimit))
713+
mxactLimit=oldestMxact;
714+
else
715+
mxactLimit=safeMxactLimit;
710716
}
711717

712718
*multiXactCutoff=mxactLimit;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp