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

Commitec97db3

Browse files
committed
Adjust assertion in XLogDecodeNextRecord.
As written, if you use XLogBeginRead() to position an xlogreader atthe beginning of a WAL page and then try to read WAL, this assertionwill fail. However, the header comment for XLogBeginRead() claimsthat positioning an xlogreader at the beginning of a page is valid,and the code here is perfectly able to cope with it. It's only theassertion that causes trouble. So relax it.This is formally a bug in all supported branches, but as it doesn'tseem to have any consequences for current uses of the xlogreaderfacility, no back-patch, at least for now.Dilip Kumar and Robert HaasDiscussion:http://postgr.es/m/CA+TgmoaJSs2_7WHW2GzFYe9+zfPtxBKvT3GW47+x=ptUE=cULw@mail.gmail.com
1 parente6dbb48 commitec97db3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,11 @@ XLogDecodeNextRecord(XLogReaderState *state, bool nonblocking)
576576
/*
577577
* Caller supplied a position to start at.
578578
*
579-
* In this case, NextRecPtr should already be pointing to a valid
580-
* record starting position.
579+
* In this case, NextRecPtr should already be pointing either to a
580+
* valid record starting position or alternatively to the beginning of
581+
* a page. See the header comments for XLogBeginRead.
581582
*/
582-
Assert(XRecOffIsValid(RecPtr));
583+
Assert(RecPtr %XLOG_BLCKSZ==0||XRecOffIsValid(RecPtr));
583584
randAccess= true;
584585
}
585586

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp