forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6dced63
committed
Fix control file update done in restartpoints still running after promotion
If a cluster is promoted (aka the control file shows a state differentthan DB_IN_ARCHIVE_RECOVERY) while CreateRestartPoint() is stillprocessing, this function could miss an update of the control file for"checkPoint" and "checkPointCopy" but still do the recycling and/orremoval of the past WAL segments, assuming that the to-be-updated LSNvalues should be used as reference points for the cleanup. This causesa follow-up restart attempting crash recovery to fail with a PANIC on amissing checkpoint record if the end-of-recovery checkpoint triggered bythe promotion did not complete while the cluster abruptly stopped orcrashed before the completion of this checkpoint. The PANIC would becaused by the redo LSN referred in the control file as located in asegment already gone, recycled by the previous restartpoint with"checkPoint" out-of-sync in the control file.This commit fixes the update of the control file during restartpoints soas "checkPoint" and "checkPointCopy" are updated even if the cluster hasbeen promoted while a restartpoint is running, to be on par with the setof WAL segments actually recycled in the end of CreateRestartPoint().7863ee4 has fixed this problem already on master, but the release timingof the latest point versions did not let me enough time to study and fixthat on all the stable branches.Reported-by: Fujii Masao, Rui ZhaoAuthor: Kyotaro HoriguchiReviewed-by: Nathan Bossart, Michael PaquierDiscussion:https://postgr.es/m/20220316.102444.2193181487576617583.horikyota.ntt@gmail.comBackpatch-through: 101 parentac51c9f commit6dced63
1 file changed
+29
-15
lines changedLines changed: 29 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9692 | 9692 |
| |
9693 | 9693 |
| |
9694 | 9694 |
| |
9695 |
| - | |
9696 |
| - | |
9697 |
| - | |
9698 |
| - | |
| 9695 | + | |
| 9696 | + | |
| 9697 | + | |
| 9698 | + | |
9699 | 9699 |
| |
9700 | 9700 |
| |
9701 |
| - | |
9702 |
| - | |
| 9701 | + | |
9703 | 9702 |
| |
| 9703 | + | |
| 9704 | + | |
| 9705 | + | |
| 9706 | + | |
| 9707 | + | |
9704 | 9708 |
| |
9705 | 9709 |
| |
9706 | 9710 |
| |
9707 | 9711 |
| |
9708 | 9712 |
| |
9709 |
| - | |
| 9713 | + | |
| 9714 | + | |
9710 | 9715 |
| |
9711 | 9716 |
| |
9712 | 9717 |
| |
| |||
9715 | 9720 |
| |
9716 | 9721 |
| |
9717 | 9722 |
| |
| 9723 | + | |
| 9724 | + | |
| 9725 | + | |
| 9726 | + | |
| 9727 | + | |
| 9728 | + | |
9718 | 9729 |
| |
9719 |
| - | |
| 9730 | + | |
9720 | 9731 |
| |
9721 |
| - | |
9722 |
| - | |
| 9732 | + | |
| 9733 | + | |
| 9734 | + | |
| 9735 | + | |
9723 | 9736 |
| |
9724 |
| - | |
9725 |
| - | |
9726 |
| - | |
| 9737 | + | |
| 9738 | + | |
| 9739 | + | |
| 9740 | + | |
| 9741 | + | |
| 9742 | + | |
9727 | 9743 |
| |
9728 |
| - | |
9729 |
| - | |
9730 | 9744 |
| |
9731 | 9745 |
| |
9732 | 9746 |
| |
|
0 commit comments
Comments
(0)