@@ -363,7 +363,7 @@ static void ExtendMultiXactOffset(MultiXactId multi);
363363static void ExtendMultiXactMember (MultiXactOffset offset , int nmembers );
364364static bool MultiXactOffsetWouldWrap (MultiXactOffset boundary ,
365365 MultiXactOffset start , uint32 distance );
366- static bool SetOffsetVacuumLimit (void );
366+ static bool SetOffsetVacuumLimit (bool is_startup );
367367static bool find_multixact_start (MultiXactId multi , MultiXactOffset * result );
368368static void WriteMZeroPageXlogRec (int pageno , uint8 info );
369369static void WriteMTruncateXlogRec (Oid oldestMultiDB ,
@@ -2095,7 +2095,7 @@ TrimMultiXact(void)
20952095 LWLockRelease (MultiXactGenLock );
20962096
20972097 /* Now compute how far away the next members wraparound is. */
2098- SetMultiXactIdLimit (oldestMXact , oldestMXactDB );
2098+ SetMultiXactIdLimit (oldestMXact , oldestMXactDB , true );
20992099}
21002100
21012101/*
@@ -2186,9 +2186,13 @@ MultiXactSetNextMXact(MultiXactId nextMulti,
21862186 * Determine the last safe MultiXactId to allocate given the currently oldest
21872187 * datminmxid (ie, the oldest MultiXactId that might exist in any database
21882188 * of our cluster), and the OID of the (or a) database with that value.
2189+ *
2190+ * is_startup is true when we are just starting the cluster, false when we
2191+ * are updating state in a running cluster. This only affects log messages.
21892192 */
21902193void
2191- SetMultiXactIdLimit (MultiXactId oldest_datminmxid , Oid oldest_datoid )
2194+ SetMultiXactIdLimit (MultiXactId oldest_datminmxid , Oid oldest_datoid ,
2195+ bool is_startup )
21922196{
21932197 MultiXactId multiVacLimit ;
21942198 MultiXactId multiWarnLimit ;
@@ -2277,7 +2281,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
22772281 Assert (!InRecovery );
22782282
22792283 /* Set limits for offset vacuum. */
2280- needs_offset_vacuum = SetOffsetVacuumLimit ();
2284+ needs_offset_vacuum = SetOffsetVacuumLimit (is_startup );
22812285
22822286 /*
22832287 * If past the autovacuum force point, immediately signal an autovac
@@ -2370,7 +2374,7 @@ MultiXactAdvanceOldest(MultiXactId oldestMulti, Oid oldestMultiDB)
23702374 Assert (InRecovery );
23712375
23722376 if (MultiXactIdPrecedes (MultiXactState -> oldestMultiXactId , oldestMulti ))
2373- SetMultiXactIdLimit (oldestMulti , oldestMultiDB );
2377+ SetMultiXactIdLimit (oldestMulti , oldestMultiDB , false );
23742378}
23752379
23762380/*
@@ -2537,7 +2541,7 @@ GetOldestMultiXactId(void)
25372541 * otherwise.
25382542 */
25392543static bool
2540- SetOffsetVacuumLimit (void )
2544+ SetOffsetVacuumLimit (bool is_startup )
25412545{
25422546 MultiXactId oldestMultiXactId ;
25432547 MultiXactId nextMXact ;
@@ -2619,9 +2623,10 @@ SetOffsetVacuumLimit(void)
26192623 /* always leave one segment before the wraparound point */
26202624 offsetStopLimit -= (MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT );
26212625
2622- if (!prevOldestOffsetKnown && IsUnderPostmaster )
2626+ if (!prevOldestOffsetKnown && ! is_startup )
26232627 ereport (LOG ,
26242628 (errmsg ("MultiXact member wraparound protections are now enabled" )));
2629+
26252630 ereport (DEBUG1 ,
26262631 (errmsg ("MultiXact member stop limit is now %u based on MultiXact %u" ,
26272632 offsetStopLimit , oldestMultiXactId )));
@@ -3312,7 +3317,7 @@ multixact_redo(XLogReaderState *record)
33123317 * Advance the horizon values, so they're current at the end of
33133318 * recovery.
33143319 */
3315- SetMultiXactIdLimit (xlrec .endTruncOff , xlrec .oldestMultiDB );
3320+ SetMultiXactIdLimit (xlrec .endTruncOff , xlrec .oldestMultiDB , false );
33163321
33173322 PerformMembersTruncation (xlrec .startTruncMemb , xlrec .endTruncMemb );
33183323
0 commit comments