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

Commit6bda2af

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 parent0d21f91 commit6bda2af

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
@@ -893,6 +893,7 @@ vacuum_set_xid_limits(Relation rel,
893893
inteffective_multixact_freeze_max_age;
894894
TransactionIdlimit;
895895
TransactionIdsafeLimit;
896+
MultiXactIdoldestMxact;
896897
MultiXactIdmxactLimit;
897898
MultiXactIdsafeMxactLimit;
898899

@@ -970,7 +971,8 @@ vacuum_set_xid_limits(Relation rel,
970971
Assert(mxid_freezemin >=0);
971972

972973
/* compute the cutoff multi, being careful to generate a valid value */
973-
mxactLimit=GetOldestMultiXactId()-mxid_freezemin;
974+
oldestMxact=GetOldestMultiXactId();
975+
mxactLimit=oldestMxact-mxid_freezemin;
974976
if (mxactLimit<FirstMultiXactId)
975977
mxactLimit=FirstMultiXactId;
976978

@@ -984,7 +986,11 @@ vacuum_set_xid_limits(Relation rel,
984986
ereport(WARNING,
985987
(errmsg("oldest multixact is far in the past"),
986988
errhint("Close open transactions with multixacts soon to avoid wraparound problems.")));
987-
mxactLimit=safeMxactLimit;
989+
/* Use the safe limit, unless an older mxact is still running */
990+
if (MultiXactIdPrecedes(oldestMxact,safeMxactLimit))
991+
mxactLimit=oldestMxact;
992+
else
993+
mxactLimit=safeMxactLimit;
988994
}
989995

990996
*multiXactCutoff=mxactLimit;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp