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

Commit6a4fe11

Browse files
committed
Fix more hash index bugs around marking buffers dirty.
In _hash_freeovflpage(), if we're freeing the overflow page thatimmediate follows the page to which tuples are being moved (theconfusingly-named "write buffer"), don't forget to mark thatpage dirty after updating its hasho_nextblkno.In _hash_squeezebucket(), it's not necessary to mark the primarybucket page dirty if there are no overflow pages, because there'snothing to squeeze in that case.Amit Kapila, with help from Kuntal Ghosh and Dilip Kumar, afteran initial trouble report by Jeff Janes.
1 parent25216c9 commit6a4fe11

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf, Buffer wbuf,
452452
MarkBufferDirty(prevbuf);
453453
_hash_relbuf(rel,prevbuf);
454454
}
455+
else
456+
{
457+
/* ensure to mark prevbuf as dirty */
458+
wbuf_dirty= true;
459+
}
455460
}
456461

457462
/* write and unlock the write buffer */
@@ -643,7 +648,7 @@ _hash_squeezebucket(Relation rel,
643648
*/
644649
if (!BlockNumberIsValid(wopaque->hasho_nextblkno))
645650
{
646-
_hash_chgbufaccess(rel,wbuf,HASH_WRITE,HASH_NOLOCK);
651+
_hash_chgbufaccess(rel,wbuf,HASH_READ,HASH_NOLOCK);
647652
return;
648653
}
649654

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp