mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-03 03:00:56 +08:00
Added check to confirm in deletion list before marking as deleted
This commit is contained in:
@@ -637,6 +637,7 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
||||
Page npage;
|
||||
BlockNumber neighborPage;
|
||||
OffsetNumber neighborOffno;
|
||||
ItemPointerData indextid;
|
||||
|
||||
/* Skip neighbor tuples */
|
||||
if (!HnswIsElementTuple(etup))
|
||||
@@ -656,6 +657,18 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
||||
if (ItemPointerIsValid(&etup->heaptids[0]))
|
||||
continue;
|
||||
|
||||
/* Confirm in deletion list */
|
||||
ItemPointerSet(&indextid, blkno, offno);
|
||||
if (!DeletingElement(vacuumstate->deleting, &indextid))
|
||||
{
|
||||
/*
|
||||
* Should not happen, but skip if it does since there may be
|
||||
* connections from other elements
|
||||
*/
|
||||
elog(INFO, "hnsw element not in deletion list");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get neighbor page */
|
||||
neighborPage = ItemPointerGetBlockNumber(&etup->neighbortid);
|
||||
neighborOffno = ItemPointerGetOffsetNumber(&etup->neighbortid);
|
||||
|
||||
Reference in New Issue
Block a user