diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c index ee34039..43b63de 100644 --- a/src/hnswvacuum.c +++ b/src/hnswvacuum.c @@ -257,10 +257,6 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate) * ideal. */ - /* Wait for inserts to complete */ - LockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock); - UnlockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock); - if (!BlockNumberIsValid(highestPoint->blkno)) highestPoint = NULL; @@ -319,6 +315,10 @@ RepairGraph(HnswVacuumState * vacuumstate) RepairGraphEntryPoint(vacuumstate); + /* Wait for inserts to complete */ + LockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock); + UnlockPage(index, HNSW_METAPAGE_BLKNO, ExclusiveLock); + while (BlockNumberIsValid(blkno)) { Buffer buf;