From 08420b6404fee34dce094ef76b442f86cf74c289 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 22 Sep 2024 10:10:55 -0700 Subject: [PATCH] Updated comment [skip ci] --- src/hnswscan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hnswscan.c b/src/hnswscan.c index ce1a5fc..92913ac 100644 --- a/src/hnswscan.c +++ b/src/hnswscan.c @@ -235,8 +235,12 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir) { /* * Locking ensures when neighbors are read, the elements they - * reference will not be marked as deleted (and replaced) - * during the iteration + * reference will not be deleted (and replaced) during the + * iteration. + * + * Elements loaded into memory on previous iterations may have + * been deleted (and replaced), so when reading neighbors, the + * element version must be checked. */ LockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);