Commit 1e78d81
committed
Don't open a WAL segment for writing at end of recovery.
Since commit ba94518, we used XLogFileOpen to open the next segment for
writing, but if the end-of-recovery happens exactly at a segment boundary,
the new segment might not exist yet. (Before ba94518, XLogFileOpen was
correct, because we would open the previous segment if the switch happened
at the boundary.)
Instead of trying to create it if necessary, it's simpler to not bother
opening the segment at all. XLogWrite() will open or create it soon anyway,
after writing the checkpoint or end-of-recovery record.
Reported by Andres Freund.1 parent 79af9a1 commit 1e78d81
1 file changed
+0
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5646 | 5646 | | |
5647 | 5647 | | |
5648 | 5648 | | |
5649 | | - | |
5650 | 5649 | | |
5651 | 5650 | | |
5652 | 5651 | | |
| |||
6633 | 6632 | | |
6634 | 6633 | | |
6635 | 6634 | | |
6636 | | - | |
6637 | 6635 | | |
6638 | 6636 | | |
6639 | 6637 | | |
| |||
6741 | 6739 | | |
6742 | 6740 | | |
6743 | 6741 | | |
6744 | | - | |
6745 | | - | |
6746 | | - | |
6747 | 6742 | | |
6748 | 6743 | | |
6749 | 6744 | | |
| |||
0 commit comments