- Notifications
You must be signed in to change notification settings - Fork5
Commit970fb12
committed
Consistency check should compare last record replayed, not last record read.
EndRecPtr is the last record that we've read, but not necessarily yetreplayed. CheckRecoveryConsistency should compare minRecoveryPoint with thelast replayed record instead. This caused recovery to think it's reachedconsistency too early.Now that we do the check in CheckRecoveryConsistency correctly, we have tomove the call of that function to after redoing a record. The current place,after reading a record but before replaying it, is wrong. In particular, ifthere are no more records after the one ending at minRecoveryPoint, we don'tenter hot standby until one extra record is generated and read by thestandby, and CheckRecoveryConsistency is called. These two bugs conspiredto make the code appear to work correctly, except for the small windowbetween reading the last record that reaches minRecoveryPoint, andreplaying it.In the passing, rename recoveryLastRecPtr, which is the last recordreplayed, to lastReplayedEndRecPtr. This makes it slightly less confusingwith replayEndRecPtr, which is the last record read that we're about toreplay.Original report from Kyotaro HORIGUCHI, further diagnosis by Fujii Masao.Backpatch to 9.0, where Hot Standby subtly changed the test from"minRecoveryPoint < EndRecPtr" to "minRecoveryPoint <= EndRecPtr". Theformer works because where the test is performed, we have always read onemore record than we've replayed.1 parentad69bd0 commit970fb12
1 file changed
+21
-15
lines changedLines changed: 21 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
445 | 445 |
| |
446 | 446 |
| |
447 | 447 |
| |
448 |
| - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
449 | 455 |
| |
450 | 456 |
| |
451 |
| - | |
452 |
| - | |
453 | 457 |
| |
454 | 458 |
| |
455 | 459 |
| |
| |||
5745 | 5749 |
| |
5746 | 5750 |
| |
5747 | 5751 |
| |
5748 |
| - | |
| 5752 | + | |
5749 | 5753 |
| |
5750 | 5754 |
| |
5751 | 5755 |
| |
| |||
5759 | 5763 |
| |
5760 | 5764 |
| |
5761 | 5765 |
| |
5762 |
| - | |
| 5766 | + | |
5763 | 5767 |
| |
5764 | 5768 |
| |
5765 | 5769 |
| |
| |||
5851 | 5855 |
| |
5852 | 5856 |
| |
5853 | 5857 |
| |
5854 |
| - | |
5855 |
| - | |
5856 |
| - | |
5857 | 5858 |
| |
5858 | 5859 |
| |
5859 | 5860 |
| |
| |||
5983 | 5984 |
| |
5984 | 5985 |
| |
5985 | 5986 |
| |
5986 |
| - | |
5987 |
| - | |
| 5987 | + | |
| 5988 | + | |
5988 | 5989 |
| |
5989 | 5990 |
| |
5990 |
| - | |
| 5991 | + | |
5991 | 5992 |
| |
5992 | 5993 |
| |
5993 | 5994 |
| |
5994 | 5995 |
| |
5995 | 5996 |
| |
| 5997 | + | |
| 5998 | + | |
| 5999 | + | |
5996 | 6000 |
| |
5997 | 6001 |
| |
5998 | 6002 |
| |
| |||
6383 | 6387 |
| |
6384 | 6388 |
| |
6385 | 6389 |
| |
6386 |
| - | |
| 6390 | + | |
| 6391 | + | |
6387 | 6392 |
| |
6388 | 6393 |
| |
6389 |
| - | |
| 6394 | + | |
6390 | 6395 |
| |
6391 | 6396 |
| |
6392 | 6397 |
| |
| |||
6398 | 6403 |
| |
6399 | 6404 |
| |
6400 | 6405 |
| |
6401 |
| - | |
| 6406 | + | |
| 6407 | + | |
6402 | 6408 |
| |
6403 | 6409 |
| |
6404 | 6410 |
| |
| |||
9094 | 9100 |
| |
9095 | 9101 |
| |
9096 | 9102 |
| |
9097 |
| - | |
| 9103 | + | |
9098 | 9104 |
| |
9099 | 9105 |
| |
9100 | 9106 |
| |
|
0 commit comments
Comments
(0)