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

Commit73f0a13

Browse files
committed
Pass correct count to WALRead().
Previously, some callers requested XLOG_BLCKSZ bytesunconditionally. While this did not cause a problem, because the extrabytes are ignored, it's confusing and makes it harder to add safetychecks. Additionally, the comment about zero padding was incorrect.With this commit, all callers request the number of bytes theyactually need.Author: Bharath RupireddyReviewed-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/CALj2ACWBRFac2TingD3PE3w2EBHXUHY3=AEEZPJmqhpEOBGExg@mail.gmail.com
1 parent9ecbf54 commit73f0a13

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,7 @@ read_local_xlog_page_guts(XLogReaderState *state, XLogRecPtr targetPagePtr,
10071007
count=read_upto-targetPagePtr;
10081008
}
10091009

1010-
/*
1011-
* Even though we just determined how much of the page can be validly read
1012-
* as 'count', read the whole page anyway. It's guaranteed to be
1013-
* zero-padded up to the page boundary if it's incomplete.
1014-
*/
1015-
if (!WALRead(state,cur_page,targetPagePtr,XLOG_BLCKSZ,tli,
1010+
if (!WALRead(state,cur_page,targetPagePtr,count,tli,
10161011
&errinfo))
10171012
WALReadRaiseError(&errinfo);
10181013

‎src/backend/postmaster/walsummarizer.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,7 @@ summarizer_read_local_xlog_page(XLogReaderState *state,
13181318
}
13191319
}
13201320

1321-
/*
1322-
* Even though we just determined how much of the page can be validly read
1323-
* as 'count', read the whole page anyway. It's guaranteed to be
1324-
* zero-padded up to the page boundary if it's incomplete.
1325-
*/
1326-
if (!WALRead(state,cur_page,targetPagePtr,XLOG_BLCKSZ,
1321+
if (!WALRead(state,cur_page,targetPagePtr,count,
13271322
private_data->tli,&errinfo))
13281323
WALReadRaiseError(&errinfo);
13291324

‎src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ logical_read_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr, int req
10991099
if (!WALRead(state,
11001100
cur_page,
11011101
targetPagePtr,
1102-
XLOG_BLCKSZ,
1102+
count,
11031103
currTLI,/* Pass the current TLI because only
11041104
* WalSndSegmentOpen controls whether new TLI
11051105
* is needed. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp