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

Commit5ed6fff

Browse files
committed
Make logging about multixact wraparound protection less chatty.
The original messaging design, introduced in commit068cfad, seems toochatty now that some time has elapsed since the bug fix; most installationswill be in good shape and don't really need a reminder about this on everypostmaster start.Hence, arrange to suppress the "wraparound protections are now enabled"message during startup (specifically, during the TrimMultiXact() call).The message will still appear if protection becomes effective at somelater point.Discussion:https://postgr.es/m/17211.1489189214@sss.pgh.pa.us
1 parentc6c099d commit5ed6fff

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

‎src/backend/access/transam/multixact.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static void ExtendMultiXactOffset(MultiXactId multi);
363363
staticvoidExtendMultiXactMember(MultiXactOffsetoffset,intnmembers);
364364
staticboolMultiXactOffsetWouldWrap(MultiXactOffsetboundary,
365365
MultiXactOffsetstart,uint32distance);
366-
staticboolSetOffsetVacuumLimit(void);
366+
staticboolSetOffsetVacuumLimit(boolis_startup);
367367
staticboolfind_multixact_start(MultiXactIdmulti,MultiXactOffset*result);
368368
staticvoidWriteMZeroPageXlogRec(intpageno,uint8info);
369369
staticvoidWriteMTruncateXlogRec(OidoldestMultiDB,
@@ -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
*/
21902193
void
2191-
SetMultiXactIdLimit(MultiXactIdoldest_datminmxid,Oidoldest_datoid)
2194+
SetMultiXactIdLimit(MultiXactIdoldest_datminmxid,Oidoldest_datoid,
2195+
boolis_startup)
21922196
{
21932197
MultiXactIdmultiVacLimit;
21942198
MultiXactIdmultiWarnLimit;
@@ -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
*/
25392543
staticbool
2540-
SetOffsetVacuumLimit(void)
2544+
SetOffsetVacuumLimit(boolis_startup)
25412545
{
25422546
MultiXactIdoldestMultiXactId;
25432547
MultiXactIdnextMXact;
@@ -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

‎src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4995,7 +4995,7 @@ BootStrapXLOG(void)
49954995
ShmemVariableCache->oidCount=0;
49964996
MultiXactSetNextMXact(checkPoint.nextMulti,checkPoint.nextMultiOffset);
49974997
SetTransactionIdLimit(checkPoint.oldestXid,checkPoint.oldestXidDB);
4998-
SetMultiXactIdLimit(checkPoint.oldestMulti,checkPoint.oldestMultiDB);
4998+
SetMultiXactIdLimit(checkPoint.oldestMulti,checkPoint.oldestMultiDB, true);
49994999
SetCommitTsLimit(InvalidTransactionId,InvalidTransactionId);
50005000

50015001
/* Set up the XLOG page header */
@@ -6597,7 +6597,7 @@ StartupXLOG(void)
65976597
ShmemVariableCache->oidCount=0;
65986598
MultiXactSetNextMXact(checkPoint.nextMulti,checkPoint.nextMultiOffset);
65996599
SetTransactionIdLimit(checkPoint.oldestXid,checkPoint.oldestXidDB);
6600-
SetMultiXactIdLimit(checkPoint.oldestMulti,checkPoint.oldestMultiDB);
6600+
SetMultiXactIdLimit(checkPoint.oldestMulti,checkPoint.oldestMultiDB, true);
66016601
SetCommitTsLimit(checkPoint.oldestCommitTsXid,
66026602
checkPoint.newestCommitTsXid);
66036603
XLogCtl->ckptXidEpoch=checkPoint.nextXidEpoch;

‎src/backend/commands/vacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ vac_truncate_clog(TransactionId frozenXID,
12051205
* signalling twice?
12061206
*/
12071207
SetTransactionIdLimit(frozenXID,oldestxid_datoid);
1208-
SetMultiXactIdLimit(minMulti,minmulti_datoid);
1208+
SetMultiXactIdLimit(minMulti,minmulti_datoid, false);
12091209
}
12101210

12111211

‎src/include/access/multixact.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ extern void StartupMultiXact(void);
127127
externvoidTrimMultiXact(void);
128128
externvoidShutdownMultiXact(void);
129129
externvoidSetMultiXactIdLimit(MultiXactIdoldest_datminmxid,
130-
Oidoldest_datoid);
130+
Oidoldest_datoid,
131+
boolis_startup);
131132
externvoidMultiXactGetCheckptMulti(boolis_shutdown,
132133
MultiXactId*nextMulti,
133134
MultiXactOffset*nextMultiOffset,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp