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

Commitd009f90

Browse files
committed
Further fix to the mode where we enter archive recovery after crash recovery.
I missed to returns in the middle of ReadRecord function in my previous fix.If a WAL file was not found at all during crash recovery, XLogPageRead wouldreturn 'false', and ReadRecord would return without entering archive recovery.9.2 only. In master, the code is structured differently and does not have thisproblem.Kyotaro HORIGUCHI, Mitsumasa KONDO and me.
1 parentc52ba36 commitd009f90

File tree

1 file changed

+23
-2
lines changed
  • src/backend/access/transam

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,7 +4010,16 @@ ReadRecord(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt)
40104010
retry:
40114011
/* Read the page containing the record */
40124012
if (!XLogPageRead(RecPtr,emode,fetching_ckpt,randAccess))
4013-
returnNULL;
4013+
{
4014+
/*
4015+
* In standby-mode, XLogPageRead returning false means that promotion
4016+
* has been triggered.
4017+
*/
4018+
if (StandbyMode)
4019+
returnNULL;
4020+
else
4021+
gotonext_record_is_invalid;
4022+
}
40144023

40154024
pageHeaderSize=XLogPageHeaderSize((XLogPageHeader)readBuf);
40164025
targetRecOff=RecPtr->xrecoff %XLOG_BLCKSZ;
@@ -4168,7 +4177,16 @@ ReadRecord(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt)
41684177
}
41694178
/* Wait for the next page to become available */
41704179
if (!XLogPageRead(&pagelsn,emode, false, false))
4171-
returnNULL;
4180+
{
4181+
/*
4182+
* In standby-mode, XLogPageRead returning false means that
4183+
* promotion has been triggered.
4184+
*/
4185+
if (StandbyMode)
4186+
returnNULL;
4187+
else
4188+
gotonext_record_is_invalid;
4189+
}
41724190

41734191
/* Check that the continuation record looks valid */
41744192
if (!(((XLogPageHeader)readBuf)->xlp_info&XLP_FIRST_IS_CONTRECORD))
@@ -10326,6 +10344,9 @@ CancelBackup(void)
1032610344
* and call XLogPageRead() again with the same arguments. This lets
1032710345
* XLogPageRead() to try fetching the record from another source, or to
1032810346
* sleep and retry.
10347+
*
10348+
* In standby mode, this only returns false if promotion has been triggered.
10349+
* Otherwise it keeps sleeping and retrying indefinitely.
1032910350
*/
1033010351
staticbool
1033110352
XLogPageRead(XLogRecPtr*RecPtr,intemode,boolfetching_ckpt,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp