mirror of
https://github.com/pgvector/pgvector.git
synced 2026-12-04 08:18:46 +00:00
Fix HNSW insert and vacuum race
This commit is contained in:
1 parent
0dbc1a27c0
commit
ffe28bb954
1 file changed
+6
-3
+6
-3
@@ -584,13 +584,16 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
||||
BufferAccessStrategy bas = vacuumstate->bas;
|
||||
|
||||
/*
|
||||
* Wait for index scans to complete. Scans before this point may contain
|
||||
* tuples about to be deleted. Scans after this point will not, since the
|
||||
* graph has been repaired.
|
||||
* Wait for index scans and inserts to complete. Scans and inserts before
|
||||
* this point may contain tuples about to be deleted. Scans and inserts
|
||||
* after this point will not, since the graph has been repaired.
|
||||
*/
|
||||
LockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
||||
UnlockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
|
||||
|
||||
LockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
|
||||
UnlockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
|
||||
|
||||
while (BlockNumberIsValid(blkno))
|
||||
{
|
||||
Buffer buf;
|
||||
|
||||
Reference in new issue
Block a user