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

Commit1e78d81

Browse files
committed
Don't open a WAL segment for writing at end of recovery.
Since commitba94518, we used XLogFileOpen to open the next segment forwriting, but if the end-of-recovery happens exactly at a segment boundary,the new segment might not exist yet. (Beforeba94518, XLogFileOpen wascorrect, because we would open the previous segment if the switch happenedat the boundary.)Instead of trying to create it if necessary, it's simpler to not botheropening 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 parent79af9a1 commit1e78d81

File tree

1 file changed

+0
-5
lines changed
  • src/backend/access/transam

1 file changed

+0
-5
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5646,7 +5646,6 @@ StartupXLOG(void)
56465646
XLogRecPtrRecPtr,
56475647
checkPointLoc,
56485648
EndOfLog;
5649-
XLogSegNostartLogSegNo;
56505649
TimeLineIDPrevTimeLineID;
56515650
XLogRecord*record;
56525651
TransactionIdoldestActiveXID;
@@ -6633,7 +6632,6 @@ StartupXLOG(void)
66336632
*/
66346633
record=ReadRecord(xlogreader,LastRec,PANIC, false);
66356634
EndOfLog=EndRecPtr;
6636-
XLByteToSeg(EndOfLog,startLogSegNo);
66376635

66386636
/*
66396637
* Complain if we did not roll forward far enough to render the backup
@@ -6741,9 +6739,6 @@ StartupXLOG(void)
67416739
* buffer cache using the block containing the last record from the
67426740
* previous incarnation.
67436741
*/
6744-
openLogSegNo=startLogSegNo;
6745-
openLogFile=XLogFileOpen(openLogSegNo);
6746-
openLogOff=0;
67476742
Insert=&XLogCtl->Insert;
67486743
Insert->PrevBytePos=XLogRecPtrToBytePos(LastRec);
67496744
Insert->CurrBytePos=XLogRecPtrToBytePos(EndOfLog);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp