@@ -252,16 +252,8 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
252
252
highestPoint = NULL ;
253
253
254
254
/*
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.
265
257
*/
266
258
if (highestPoint != NULL )
267
259
{
@@ -293,12 +285,20 @@ RepairGraphEntryPoint(HnswVacuumState * vacuumstate)
293
285
294
286
if (DeletedContains (vacuumstate -> deleted , & epData ))
295
287
{
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
+ */
297
293
HnswUpdateMetaPage (index , HNSW_UPDATE_ENTRY_ALWAYS , highestPoint , InvalidBlockNumber , MAIN_FORKNUM );
298
294
}
299
295
else
300
296
{
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
+ */
302
302
HnswLoadElement (entryPoint , NULL , NULL , index , vacuumstate -> procinfo , vacuumstate -> collation , true);
303
303
304
304
if (NeedsUpdated (vacuumstate , entryPoint ))
0 commit comments