@@ -363,7 +363,7 @@ static void ExtendMultiXactOffset(MultiXactId multi);
363
363
static void ExtendMultiXactMember (MultiXactOffset offset , int nmembers );
364
364
static bool MultiXactOffsetWouldWrap (MultiXactOffset boundary ,
365
365
MultiXactOffset start , uint32 distance );
366
- static bool SetOffsetVacuumLimit (void );
366
+ static bool SetOffsetVacuumLimit (bool is_startup );
367
367
static bool find_multixact_start (MultiXactId multi , MultiXactOffset * result );
368
368
static void WriteMZeroPageXlogRec (int pageno , uint8 info );
369
369
static void WriteMTruncateXlogRec (Oid oldestMultiDB ,
@@ -2095,7 +2095,7 @@ TrimMultiXact(void)
2095
2095
LWLockRelease (MultiXactGenLock );
2096
2096
2097
2097
/* Now compute how far away the next members wraparound is. */
2098
- SetMultiXactIdLimit (oldestMXact , oldestMXactDB );
2098
+ SetMultiXactIdLimit (oldestMXact , oldestMXactDB , true );
2099
2099
}
2100
2100
2101
2101
/*
@@ -2186,9 +2186,13 @@ MultiXactSetNextMXact(MultiXactId nextMulti,
2186
2186
* Determine the last safe MultiXactId to allocate given the currently oldest
2187
2187
* datminmxid (ie, the oldest MultiXactId that might exist in any database
2188
2188
* 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.
2189
2192
*/
2190
2193
void
2191
- SetMultiXactIdLimit (MultiXactId oldest_datminmxid , Oid oldest_datoid )
2194
+ SetMultiXactIdLimit (MultiXactId oldest_datminmxid , Oid oldest_datoid ,
2195
+ bool is_startup )
2192
2196
{
2193
2197
MultiXactId multiVacLimit ;
2194
2198
MultiXactId multiWarnLimit ;
@@ -2277,7 +2281,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
2277
2281
Assert (!InRecovery );
2278
2282
2279
2283
/* Set limits for offset vacuum. */
2280
- needs_offset_vacuum = SetOffsetVacuumLimit ();
2284
+ needs_offset_vacuum = SetOffsetVacuumLimit (is_startup );
2281
2285
2282
2286
/*
2283
2287
* If past the autovacuum force point, immediately signal an autovac
@@ -2370,7 +2374,7 @@ MultiXactAdvanceOldest(MultiXactId oldestMulti, Oid oldestMultiDB)
2370
2374
Assert (InRecovery );
2371
2375
2372
2376
if (MultiXactIdPrecedes (MultiXactState -> oldestMultiXactId , oldestMulti ))
2373
- SetMultiXactIdLimit (oldestMulti , oldestMultiDB );
2377
+ SetMultiXactIdLimit (oldestMulti , oldestMultiDB , false );
2374
2378
}
2375
2379
2376
2380
/*
@@ -2537,7 +2541,7 @@ GetOldestMultiXactId(void)
2537
2541
* otherwise.
2538
2542
*/
2539
2543
static bool
2540
- SetOffsetVacuumLimit (void )
2544
+ SetOffsetVacuumLimit (bool is_startup )
2541
2545
{
2542
2546
MultiXactId oldestMultiXactId ;
2543
2547
MultiXactId nextMXact ;
@@ -2619,9 +2623,10 @@ SetOffsetVacuumLimit(void)
2619
2623
/* always leave one segment before the wraparound point */
2620
2624
offsetStopLimit -= (MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT );
2621
2625
2622
- if (!prevOldestOffsetKnown && IsUnderPostmaster )
2626
+ if (!prevOldestOffsetKnown && ! is_startup )
2623
2627
ereport (LOG ,
2624
2628
(errmsg ("MultiXact member wraparound protections are now enabled" )));
2629
+
2625
2630
ereport (DEBUG1 ,
2626
2631
(errmsg ("MultiXact member stop limit is now %u based on MultiXact %u" ,
2627
2632
offsetStopLimit , oldestMultiXactId )));
@@ -3312,7 +3317,7 @@ multixact_redo(XLogReaderState *record)
3312
3317
* Advance the horizon values, so they're current at the end of
3313
3318
* recovery.
3314
3319
*/
3315
- SetMultiXactIdLimit (xlrec .endTruncOff , xlrec .oldestMultiDB );
3320
+ SetMultiXactIdLimit (xlrec .endTruncOff , xlrec .oldestMultiDB , false );
3316
3321
3317
3322
PerformMembersTruncation (xlrec .startTruncMemb , xlrec .endTruncMemb );
3318
3323
0 commit comments