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

Commit594bac4

Browse files
committed
Fix WAL replay bug in the new GIN incomplete-split code.
Forgot to set the incomplete-split flag on the left page half, in redo of apage split.Spotted this by comparing the page contents on master and standby, afterinserting/applying each WAL record.
1 parent7d8f1de commit594bac4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/backend/access/gin/ginxlog.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ ginRedoSplit(XLogRecPtr lsn, XLogRecord *record)
461461
rbuffer;
462462
Pagelpage,
463463
rpage;
464-
uint32flags=0;
464+
uint32flags;
465+
uint32lflags,
466+
rflags;
465467
char*payload;
466468
boolisLeaf= (data->flags&GIN_INSERT_ISLEAF)!=0;
467469
boolisData= (data->flags&GIN_INSERT_ISDATA)!=0;
@@ -481,22 +483,27 @@ ginRedoSplit(XLogRecPtr lsn, XLogRecord *record)
481483
ginRedoClearIncompleteSplit(lsn,data->node,data->leftChildBlkno);
482484
}
483485

486+
flags=0;
484487
if (isLeaf)
485488
flags |=GIN_LEAF;
486489
if (isData)
487490
flags |=GIN_DATA;
488491
if (isLeaf&&isData)
489492
flags |=GIN_COMPRESSED;
490493

494+
lflags=rflags=flags;
495+
if (!isRoot)
496+
lflags |=GIN_INCOMPLETE_SPLIT;
497+
491498
lbuffer=XLogReadBuffer(data->node,data->lblkno, true);
492499
Assert(BufferIsValid(lbuffer));
493500
lpage= (Page)BufferGetPage(lbuffer);
494-
GinInitBuffer(lbuffer,flags);
501+
GinInitBuffer(lbuffer,lflags);
495502

496503
rbuffer=XLogReadBuffer(data->node,data->rblkno, true);
497504
Assert(BufferIsValid(rbuffer));
498505
rpage= (Page)BufferGetPage(rbuffer);
499-
GinInitBuffer(rbuffer,flags);
506+
GinInitBuffer(rbuffer,rflags);
500507

501508
GinPageGetOpaque(lpage)->rightlink=BufferGetBlockNumber(rbuffer);
502509
GinPageGetOpaque(rpage)->rightlink=isRoot ?InvalidBlockNumber :data->rrlink;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp