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

Commit583d86f

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 parente86ece2 commit583d86f

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
@@ -526,6 +526,7 @@ vacuum_set_xid_limits(Relation rel,
526526
inteffective_multixact_freeze_max_age;
527527
TransactionIdlimit;
528528
TransactionIdsafeLimit;
529+
MultiXactIdoldestMxact;
529530
MultiXactIdmxactLimit;
530531
MultiXactIdsafeMxactLimit;
531532

@@ -602,7 +603,8 @@ vacuum_set_xid_limits(Relation rel,
602603
Assert(mxid_freezemin >=0);
603604

604605
/* compute the cutoff multi, being careful to generate a valid value */
605-
mxactLimit=GetOldestMultiXactId()-mxid_freezemin;
606+
oldestMxact=GetOldestMultiXactId();
607+
mxactLimit=oldestMxact-mxid_freezemin;
606608
if (mxactLimit<FirstMultiXactId)
607609
mxactLimit=FirstMultiXactId;
608610

@@ -616,7 +618,11 @@ vacuum_set_xid_limits(Relation rel,
616618
ereport(WARNING,
617619
(errmsg("oldest multixact is far in the past"),
618620
errhint("Close open transactions with multixacts soon to avoid wraparound problems.")));
619-
mxactLimit=safeMxactLimit;
621+
/* Use the safe limit, unless an older mxact is still running */
622+
if (MultiXactIdPrecedes(oldestMxact,safeMxactLimit))
623+
mxactLimit=oldestMxact;
624+
else
625+
mxactLimit=safeMxactLimit;
620626
}
621627

622628
*multiXactCutoff=mxactLimit;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp