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

Commitd3e5728

Browse files
committed
In log_newpage_range(), heed forkNum and page_std arguments.
The function assumed forkNum=MAIN_FORKNUM and page_std=true, ignoringthe actual arguments. Existing callers passed exactly those values, sothere's no live bug. Back-patch to v12, where the function firstappeared, because another fix needs this.Discussion:https://postgr.es/m/20191118045434.GA1173436@rfd.leadboat.com
1 parente629a01 commitd3e5728

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,13 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
10431043
BlockNumberstartblk,BlockNumberendblk,
10441044
boolpage_std)
10451045
{
1046+
intflags;
10461047
BlockNumberblkno;
10471048

1049+
flags=REGBUF_FORCE_IMAGE;
1050+
if (page_std)
1051+
flags |=REGBUF_STANDARD;
1052+
10481053
/*
10491054
* Iterate over all the pages in the range. They are collected into
10501055
* batches of XLR_MAX_BLOCK_ID pages, and a single WAL-record is written
@@ -1066,7 +1071,8 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
10661071
nbufs=0;
10671072
while (nbufs<XLR_MAX_BLOCK_ID&&blkno<endblk)
10681073
{
1069-
Bufferbuf=ReadBuffer(rel,blkno);
1074+
Bufferbuf=ReadBufferExtended(rel,forkNum,blkno,
1075+
RBM_NORMAL,NULL);
10701076

10711077
LockBuffer(buf,BUFFER_LOCK_EXCLUSIVE);
10721078

@@ -1088,7 +1094,7 @@ log_newpage_range(Relation rel, ForkNumber forkNum,
10881094
START_CRIT_SECTION();
10891095
for (i=0;i<nbufs;i++)
10901096
{
1091-
XLogRegisterBuffer(i,bufpack[i],REGBUF_FORCE_IMAGE |REGBUF_STANDARD);
1097+
XLogRegisterBuffer(i,bufpack[i],flags);
10921098
MarkBufferDirty(bufpack[i]);
10931099
}
10941100

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp