forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf1b8a84
committed
Avoid problems with OID wraparound during WAL replay.
Fix a longstanding thinko in replay of NEXTOID and checkpoint records: wetried to advance nextOid only if it was behind the value in the WAL record,but the comparison would draw the wrong conclusion if OID wraparound hadoccurred since the previous value. Better to just unconditionally assignthe new value, since OID assignment shouldn't be happening during replayanyway.The consequences of a failure to update nextOid would be pretty minimal,since we have long had the code set up to obtain another OID and try againif the generated value is already in use. But in the worst case therecould be significant performance glitches while such loops iterate throughmany already-used OIDs before finding a free one.The odds of a wraparound happening during WAL replay would be small in acrash-recovery scenario, and the length of any ensuing OID-assignment stallquite limited anyway. But neither of these statements hold true for areplication slave that follows a WAL stream for a long period; its behaviorupon going live could be almost unboundedly bad. Hence it seems worthback-patching this fix into all supported branches.Already fixed in HEAD in commitc6d76d7.1 parent2a84671 commitf1b8a84
1 file changed
+12
-11
lines changedLines changed: 12 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8387 | 8387 |
| |
8388 | 8388 |
| |
8389 | 8389 |
| |
| 8390 | + | |
| 8391 | + | |
| 8392 | + | |
| 8393 | + | |
| 8394 | + | |
| 8395 | + | |
8390 | 8396 |
| |
8391 |
| - | |
8392 |
| - | |
8393 |
| - | |
8394 |
| - | |
8395 |
| - | |
| 8397 | + | |
| 8398 | + | |
8396 | 8399 |
| |
8397 | 8400 |
| |
8398 | 8401 |
| |
| |||
8480 | 8483 |
| |
8481 | 8484 |
| |
8482 | 8485 |
| |
8483 |
| - | |
| 8486 | + | |
8484 | 8487 |
| |
8485 | 8488 |
| |
8486 | 8489 |
| |
8487 |
| - | |
8488 |
| - | |
8489 |
| - | |
8490 |
| - | |
8491 |
| - | |
| 8490 | + | |
| 8491 | + | |
| 8492 | + | |
8492 | 8493 |
| |
8493 | 8494 |
| |
8494 | 8495 |
| |
|
0 commit comments
Comments
(0)