@@ -485,6 +485,7 @@ vacuum_set_xid_limits(Relation rel,
485
485
TransactionId limit ;
486
486
TransactionId safeLimit ;
487
487
TransactionId nextXid ;
488
+ MultiXactId oldestMxact ;
488
489
MultiXactId mxactLimit ;
489
490
MultiXactId safeMxactLimit ;
490
491
MultiXactId nextMxactId ;
@@ -566,9 +567,9 @@ vacuum_set_xid_limits(Relation rel,
566
567
Assert (mxid_freezemin >= 0 );
567
568
568
569
/* 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 ;
572
573
else
573
574
mxactLimit = FirstMultiXactId ;
574
575
@@ -581,7 +582,11 @@ vacuum_set_xid_limits(Relation rel,
581
582
if (MultiXactIdPrecedes (mxactLimit , safeMxactLimit ))
582
583
{
583
584
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 ),
585
590
errhint ("Close open transactions with multixacts soon to avoid wraparound problems." )));
586
591
mxactLimit = safeMxactLimit ;
587
592
}
0 commit comments