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

Commit1a11d46

Browse files
committed
Don't set ThisTimeLineID in checkpointer & bgwriter during recovery.
We used to set it to the current recovery target timeline, but the recoverytarget timeline can change during recovery, leaving ThisTimeLineID at anold value. That seems worse than always leaving it at zero to begin with.AFAICS there was no good reason to set it in the first place. ThisTimeLineIDis not needed in checkpointer or bgwriter process, until it's time to writethe end-of-recovery checkpoint, and at that point ThisTimeLineID is updatedanyway.
1 parent345fb82 commit1a11d46

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2901,7 +2901,12 @@ RemoveOldXlogFiles(XLogSegNo segno, XLogRecPtr endptr)
29012901
errmsg("could not open transaction log directory \"%s\": %m",
29022902
XLOGDIR)));
29032903

2904-
XLogFileName(lastoff,ThisTimeLineID,segno);
2904+
/*
2905+
* Construct a filename of the last segment to be kept. The timeline ID
2906+
* doesn't matter, we ignore that in the comparison. (During recovery,
2907+
* ThisTimeLineID isn't set, so we can't use that.)
2908+
*/
2909+
XLogFileName(lastoff,0,segno);
29052910

29062911
elog(DEBUG2,"attempting to remove WAL segments older than log file %s",
29072912
lastoff);

‎src/backend/postmaster/bgwriter.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,6 @@ BackgroundWriterMain(void)
224224
*/
225225
PG_SETMASK(&UnBlockSig);
226226

227-
/*
228-
* Use the recovery target timeline ID during recovery
229-
*/
230-
if (RecoveryInProgress())
231-
ThisTimeLineID=GetRecoveryTargetTLI();
232-
233227
/*
234228
* Reset hibernation state after any error.
235229
*/

‎src/backend/postmaster/checkpointer.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,6 @@ CheckpointerMain(void)
346346
*/
347347
PG_SETMASK(&UnBlockSig);
348348

349-
/*
350-
* Use the recovery target timeline ID during recovery
351-
*/
352-
if (RecoveryInProgress())
353-
ThisTimeLineID=GetRecoveryTargetTLI();
354-
355349
/*
356350
* Ensure all shared memory values are set correctly for the config. Doing
357351
* this here ensures no race conditions from other concurrent updaters.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp