Improved locking code [skip ci]

This commit is contained in:
Andrew Kane
2023-08-21 15:42:59 -07:00
parent 3f3b3ca8e3
commit 0e1de45463
4 changed files with 22 additions and 10 deletions

View File

@@ -316,8 +316,8 @@ RepairGraph(HnswVacuumState * vacuumstate)
RepairGraphEntryPoint(vacuumstate);
/* Wait for inserts to complete */
LockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock);
UnlockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock);
LockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
UnlockPage(index, HNSW_UPDATE_LOCK, ExclusiveLock);
while (BlockNumberIsValid(blkno))
{
@@ -405,8 +405,8 @@ MarkDeleted(HnswVacuumState * vacuumstate)
BufferAccessStrategy bas = vacuumstate->bas;
/* Wait for selects to complete */
LockPage(index, HNSW_HEAD_BLKNO, ExclusiveLock);
UnlockPage(index, HNSW_HEAD_BLKNO, ExclusiveLock);
LockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
UnlockPage(index, HNSW_SCAN_LOCK, ExclusiveLock);
while (BlockNumberIsValid(blkno))
{