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

Commit7acf8a8

Browse files
committed
Make crash recovery ignore recovery target settings.
In v11 or before, recovery target settings could not take effect incrash recovery because they are specified in recovery.conf andcrash recovery always starts without recovery.conf. But commit2dedf4d integrated recovery.conf into postgresql.conf andwhich unexpectedly allowed recovery target settings to take effecteven in crash recovery. This is definitely not good behavior.To fix the issue, this commit makes crash recovery always ignorerecovery target settings.Back-patch to v12.Author: Peter EisentrautReviewed-by: Fujii MasaoDiscussion:https://postgr.es/m/e445616d-023e-a268-8aa1-67b8b335340c@pgmasters.net
1 parentac88807 commit7acf8a8

File tree

1 file changed

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

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5618,6 +5618,13 @@ recoveryStopsBefore(XLogReaderState *record)
56185618
TimestampTzrecordXtime=0;
56195619
TransactionIdrecordXid;
56205620

5621+
/*
5622+
* Ignore recovery target settings when not in archive recovery (meaning
5623+
* we are in crash recovery).
5624+
*/
5625+
if (!ArchiveRecoveryRequested)
5626+
return false;
5627+
56215628
/* Check if we should stop as soon as reaching consistency */
56225629
if (recoveryTarget==RECOVERY_TARGET_IMMEDIATE&&reachedConsistency)
56235630
{
@@ -5759,6 +5766,13 @@ recoveryStopsAfter(XLogReaderState *record)
57595766
uint8rmid;
57605767
TimestampTzrecordXtime;
57615768

5769+
/*
5770+
* Ignore recovery target settings when not in archive recovery (meaning
5771+
* we are in crash recovery).
5772+
*/
5773+
if (!ArchiveRecoveryRequested)
5774+
return false;
5775+
57625776
info=XLogRecGetInfo(record)& ~XLR_INFO_MASK;
57635777
rmid=XLogRecGetRmid(record);
57645778

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp