Skip to content

Commit 3b7a96a

Browse files
author
Amit Kapila
committed
During the split, set checksum on an empty hash index page.
On a split, we allocate a new splitpoint's worth of bucket pages wherein we initialize the last page with zeros which is fine, but we forgot to set the checksum for that last page. We decided to back-patch this fix till 10 because we don't have an easy way to test it in prior versions. Another reason is that the hash-index code is changed heavily in 10, so it is not advisable to push the fix without testing it in prior versions. Author: Amit Kapila Reviewed-by: Yugo Nagata Backpatch-through: 10 Discussion: https://postgr.es/m/5d03686d-727c-dbf8-0064-bf8b97ffe850@2ndquadrant.com
1 parent 504f059 commit 3b7a96a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/access/hash/hashpage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ _hash_alloc_buckets(Relation rel, BlockNumber firstblock, uint32 nblocks)
10361036
true);
10371037

10381038
RelationOpenSmgr(rel);
1039+
PageSetChecksumInplace(page, lastblock);
10391040
smgrextend(rel->rd_smgr, MAIN_FORKNUM, lastblock, zerobuf.data, false);
10401041

10411042
return true;

0 commit comments

Comments
 (0)