Skip to content

Commit 4cac3c0

Browse files
author
Alexander Korotkov
committed
More detailed error report abou multixact wraparound.
1 parent 687bc38 commit 4cac3c0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/backend/commands/vacuum.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ vacuum_set_xid_limits(Relation rel,
485485
TransactionId limit;
486486
TransactionId safeLimit;
487487
TransactionId nextXid;
488+
MultiXactId oldestMxact;
488489
MultiXactId mxactLimit;
489490
MultiXactId safeMxactLimit;
490491
MultiXactId nextMxactId;
@@ -566,9 +567,9 @@ vacuum_set_xid_limits(Relation rel,
566567
Assert(mxid_freezemin >= 0);
567568

568569
/* compute the cutoff multi, being careful to generate a valid value */
569-
mxactLimit = GetOldestMultiXactId();
570-
if (mxactLimit > FirstMultiXactId + mxid_freezemin)
571-
mxactLimit -= mxid_freezemin;
570+
oldestMxact = GetOldestMultiXactId();
571+
if (oldestMxact > FirstMultiXactId + mxid_freezemin)
572+
mxactLimit = oldestMxact - mxid_freezemin;
572573
else
573574
mxactLimit = FirstMultiXactId;
574575

@@ -581,7 +582,11 @@ vacuum_set_xid_limits(Relation rel,
581582
if (MultiXactIdPrecedes(mxactLimit, safeMxactLimit))
582583
{
583584
ereport(WARNING,
584-
(errmsg("oldest multixact is far in the past"),
585+
(errmsg("oldest multixact is far in the past: "
586+
INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT " "
587+
INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT " ",
588+
mxactLimit, mxid_freezemin, oldestMxact,
589+
safeMxactLimit, effective_multixact_freeze_max_age, nextMxactId),
585590
errhint("Close open transactions with multixacts soon to avoid wraparound problems.")));
586591
mxactLimit = safeMxactLimit;
587592
}

0 commit comments

Comments
 (0)