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

Commit2f4193c

Browse files
committed
Fix race introduced by6d46f47.
It's possible for the metapage contents to change after we releasethe lock, so we must read them before releasing the lock.Amit Kapila. Submitted in response to a trouble report fromAndreas Seltenreich, though it is not certain this fixes theproblem.
1 parent0e50af2 commit2f4193c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,21 @@ _hash_expandtable(Relation rel, Buffer metabuf)
653653
*/
654654
if (H_NEEDS_SPLIT_CLEANUP(oopaque))
655655
{
656+
/*
657+
* Copy bucket mapping info now; refer to the comment in code below
658+
* where we copy this information before calling _hash_splitbucket
659+
* to see why this is okay.
660+
*/
661+
maxbucket=metap->hashm_maxbucket;
662+
highmask=metap->hashm_highmask;
663+
lowmask=metap->hashm_lowmask;
664+
656665
/* Release the metapage lock. */
657666
_hash_chgbufaccess(rel,metabuf,HASH_READ,HASH_NOLOCK);
658667

659668
hashbucketcleanup(rel,old_bucket,buf_oblkno,start_oblkno,NULL,
660-
metap->hashm_maxbucket,metap->hashm_highmask,
661-
metap->hashm_lowmask,NULL,
662-
NULL, true,NULL,NULL);
669+
maxbucket,highmask,lowmask,NULL,NULL, true,
670+
NULL,NULL);
663671

664672
_hash_dropbuf(rel,buf_oblkno);
665673

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp