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

Commitcca705a

Browse files
committed
Fix bug in SetOffsetVacuumLimit() triggered by find_multixact_start() failure.
Previously, if find_multixact_start() failed, SetOffsetVacuumLimit() wouldinstall 0 into MultiXactState->offsetStopLimit if it previously succeeded.Luckily, there are no known cases where find_multixact_start() will returnan error in 9.5 and above. But if it were to happen, for example due tofilesystem permission issues, it'd be somewhat bad: GetNewMultiXactId()could continue allocating mxids even if close to a wraparound, or it coulderroneously stop allocating mxids, even if no wraparound is looming. Thewrong value would be corrected the next time SetOffsetVacuumLimit() iscalled, or by a restart.Reported-By: Noah Misch, although this is not his preferred fixDiscussion: 20151210140450.GA22278@alap3.anarazel.deBackpatch: 9.5, where the bug was introduced as part of 4f627f
1 parent2a35449 commitcca705a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,6 +2552,7 @@ SetOffsetVacuumLimit(void)
25522552
boololdestOffsetKnown= false;
25532553
boolprevOldestOffsetKnown;
25542554
MultiXactOffsetoffsetStopLimit=0;
2555+
MultiXactOffsetprevOffsetStopLimit;
25552556

25562557
/*
25572558
* NB: Have to prevent concurrent truncation, we might otherwise try to
@@ -2566,6 +2567,7 @@ SetOffsetVacuumLimit(void)
25662567
nextOffset=MultiXactState->nextOffset;
25672568
prevOldestOffsetKnown=MultiXactState->oldestOffsetKnown;
25682569
prevOldestOffset=MultiXactState->oldestOffset;
2570+
prevOffsetStopLimit=MultiXactState->offsetStopLimit;
25692571
Assert(MultiXactState->finishedStartup);
25702572
LWLockRelease(MultiXactGenLock);
25712573

@@ -2633,11 +2635,13 @@ SetOffsetVacuumLimit(void)
26332635
{
26342636
/*
26352637
* If we failed to get the oldest offset this time, but we have a
2636-
* value from a previous pass through this function, use the old value
2637-
* rather than automatically forcing it.
2638+
* value from a previous pass through this function, use the old
2639+
* values rather than automatically forcing an emergency autovacuum
2640+
* cycle again.
26382641
*/
26392642
oldestOffset=prevOldestOffset;
26402643
oldestOffsetKnown= true;
2644+
offsetStopLimit=prevOffsetStopLimit;
26412645
}
26422646

26432647
/* Install the computed values */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp