Skip to content

Commit 4600979

Browse files
committed
Updated comments [skip ci]
1 parent 69addf0 commit 4600979

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/hnswvacuum.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,8 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
252252
highestPoint = NULL;
253253

254254
/*
255-
* Repair graph for highest non-entry point. May be outdated due to
256-
* inserts that happen during RemoveHeapTids.
257-
*
258-
* Outdated point can remove connections at higher levels in the graph
259-
* until they are repaired. Could set the insert page to the last page at
260-
* the start of RemoveHeapTids to reduce this possibility, but likely
261-
* better to keep reusing space.
262-
*
263-
* If highest point is empty and entry point is deleted, the entry point
264-
* can be empty for a short period until a live element is repaired.
255+
* Repair graph for highest non-entry point. Highest point may be outdated
256+
* due to inserts that happen during and after RemoveHeapTids.
265257
*/
266258
if (highestPoint != NULL)
267259
{
@@ -293,12 +285,20 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
293285

294286
if (DeletedContains(vacuumstate->deleted, &epData))
295287
{
296-
/* Replace the entry point with the highest point */
288+
/*
289+
* Replace the entry point with the highest point. If highest
290+
* point is outdated and empty, the entry point will be empty
291+
* until an element is repaired.
292+
*/
297293
HnswUpdateMetaPage(index, HNSW_UPDATE_ENTRY_ALWAYS, highestPoint, InvalidBlockNumber, MAIN_FORKNUM);
298294
}
299295
else
300296
{
301-
/* Repair the entry point with the highest point */
297+
/*
298+
* Repair the entry point with the highest point. If highest point
299+
* is outdated, this can remove connections at higher levels in
300+
* the graph until they are repaired, but this should be fine.
301+
*/
302302
HnswLoadElement(entryPoint, NULL, NULL, index, vacuumstate->procinfo, vacuumstate->collation, true);
303303

304304
if (NeedsUpdated(vacuumstate, entryPoint))

0 commit comments

Comments
 (0)