mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Predicate locking in hash indexes.
Hash index searches acquire predicate locks on the primary page of a bucket. It acquires a lock on both the old and new buckets for scans that happen concurrently with page splits. During a bucket split, a predicate lock is copied from the primary page of an old bucket to the primary page of a new bucket. Author: Shubham Barai, Amit Kapila Reviewed by: Amit Kapila, Alexander Korotkov, Thomas Munro Discussion: https://www.postgresql.org/message-id/flat/CALxAEPvNsM2GTiXdRgaaZ1Pjd1bs+sxfFsf7Ytr+iq+5JJoYXA@mail.gmail.com
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "utils/rel.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/buf_internals.h"
|
||||
#include "storage/predicate.h"
|
||||
|
||||
static void _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
|
||||
RelFileNode hnode);
|
||||
@@ -88,6 +89,8 @@ restart_insert:
|
||||
&usedmetap);
|
||||
Assert(usedmetap != NULL);
|
||||
|
||||
CheckForSerializableConflictIn(rel, NULL, buf);
|
||||
|
||||
/* remember the primary bucket buffer to release the pin on it at end. */
|
||||
bucket_buf = buf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user