Wait for inserts to complete when vacuuming HNSW

This commit is contained in:
Andrew Kane
2023-08-21 00:36:32 -07:00
parent ef1209eaf4
commit 40a013a622
2 changed files with 17 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
#include "commands/vacuum.h"
#include "hnsw.h"
#include "storage/bufmgr.h"
#include "storage/lmgr.h"
#include "utils/memutils.h"
/*
@@ -256,6 +257,10 @@ 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;