From 46009795043ab29c5790901ea36adb3b826945bc Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 21 Aug 2023 22:38:09 -0700 Subject: [PATCH] Updated comments [skip ci] --- src/hnswvacuum.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/hnswvacuum.c b/src/hnswvacuum.c index 224be1a..597fd8e 100644 --- a/src/hnswvacuum.c +++ b/src/hnswvacuum.c @@ -252,16 +252,8 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate) highestPoint = NULL; /* - * Repair graph for highest non-entry point. May be outdated due to - * inserts that happen during RemoveHeapTids. - * - * Outdated point can remove connections at higher levels in the graph - * until they are repaired. Could set the insert page to the last page at - * the start of RemoveHeapTids to reduce this possibility, but likely - * better to keep reusing space. - * - * If highest point is empty and entry point is deleted, the entry point - * can be empty for a short period until a live element is repaired. + * Repair graph for highest non-entry point. Highest point may be outdated + * due to inserts that happen during and after RemoveHeapTids. */ if (highestPoint != NULL) { @@ -293,12 +285,20 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate) if (DeletedContains(vacuumstate->deleted, &epData)) { - /* Replace the entry point with the highest point */ + /* + * Replace the entry point with the highest point. If highest + * point is outdated and empty, the entry point will be empty + * until an element is repaired. + */ HnswUpdateMetaPage(index, HNSW_UPDATE_ENTRY_ALWAYS, highestPoint, InvalidBlockNumber, MAIN_FORKNUM); } else { - /* Repair the entry point with the highest point */ + /* + * Repair the entry point with the highest point. If highest point + * is outdated, this can remove connections at higher levels in + * the graph until they are repaired, but this should be fine. + */ HnswLoadElement(entryPoint, NULL, NULL, index, vacuumstate->procinfo, vacuumstate->collation, true); if (NeedsUpdated(vacuumstate, entryPoint))