From 3fba403f8f4a1be97a0bfa4627bbb66cee22463d Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 22 Sep 2024 10:07:30 -0700 Subject: [PATCH] Updated comment [skip ci] --- src/hnswscan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hnswscan.c b/src/hnswscan.c index e79a367..ce1a5fc 100644 --- a/src/hnswscan.c +++ b/src/hnswscan.c @@ -233,7 +233,11 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir) } else { - /* TODO Figure out locking */ + /* + * Locking ensures when neighbors are read, the elements they + * reference will not be marked as deleted (and replaced) + * during the iteration + */ LockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock); HnswBench("scan iteration", so->w = ResumeScanItems(scan));