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

Commitaa5edbe

Browse files
author
Amit Kapila
committed
Set LSN for wbuf in _hash_freeovflpage() iff wbuf is modified.
Commit861f86b used REGBUF_NO_CHANGE at one of the places in the hashindex to register the clean buffers but forgot to avoid setting LSN inthat case.Reported-by: Michael PaquierAuthor: Kuroda HayatoReviewed-by: Amit Kapila, Michael PaquierDiscussion:https://postgr.es/m/ZbyVVG_7eW3YD5-A@paquier.xyz
1 parent22f7e61 commitaa5edbe

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎src/backend/access/hash/hashovfl.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf,
647647
xl_hash_squeeze_pagexlrec;
648648
XLogRecPtrrecptr;
649649
inti;
650+
boolmod_wbuf= false;
650651

651652
xlrec.prevblkno=prevblkno;
652653
xlrec.nextblkno=nextblkno;
@@ -671,6 +672,10 @@ _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf,
671672
if (xlrec.ntups>0)
672673
{
673674
XLogRegisterBuffer(1,wbuf,REGBUF_STANDARD);
675+
676+
/* Remember that wbuf is modified. */
677+
mod_wbuf= true;
678+
674679
XLogRegisterBufData(1, (char*)itup_offsets,
675680
nitups*sizeof(OffsetNumber));
676681
for (i=0;i<nitups;i++)
@@ -690,7 +695,14 @@ _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf,
690695

691696
wbuf_flags=REGBUF_STANDARD;
692697
if (!xlrec.is_prev_bucket_same_wrt)
698+
{
693699
wbuf_flags |=REGBUF_NO_CHANGE;
700+
}
701+
else
702+
{
703+
/* Remember that wbuf is modified. */
704+
mod_wbuf= true;
705+
}
694706
XLogRegisterBuffer(1,wbuf,wbuf_flags);
695707
}
696708

@@ -719,7 +731,10 @@ _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf,
719731

720732
recptr=XLogInsert(RM_HASH_ID,XLOG_HASH_SQUEEZE_PAGE);
721733

722-
PageSetLSN(BufferGetPage(wbuf),recptr);
734+
/* Set LSN iff wbuf is modified. */
735+
if (mod_wbuf)
736+
PageSetLSN(BufferGetPage(wbuf),recptr);
737+
723738
PageSetLSN(BufferGetPage(ovflbuf),recptr);
724739

725740
if (BufferIsValid(prevbuf)&& !xlrec.is_prev_bucket_same_wrt)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp