mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 16:16: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;
|
Page npage;
|
||||||
BlockNumber neighborPage;
|
BlockNumber neighborPage;
|
||||||
OffsetNumber neighborOffno;
|
OffsetNumber neighborOffno;
|
||||||
|
ItemPointerData indextid;
|
||||||
|
|
||||||
/* Skip neighbor tuples */
|
/* Skip neighbor tuples */
|
||||||
if (!HnswIsElementTuple(etup))
|
if (!HnswIsElementTuple(etup))
|
||||||
@@ -656,6 +657,18 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
|||||||
if (ItemPointerIsValid(&etup->heaptids[0]))
|
if (ItemPointerIsValid(&etup->heaptids[0]))
|
||||||
continue;
|
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 */
|
/* Get neighbor page */
|
||||||
neighborPage = ItemPointerGetBlockNumber(&etup->neighbortid);
|
neighborPage = ItemPointerGetBlockNumber(&etup->neighbortid);
|
||||||
neighborOffno = ItemPointerGetOffsetNumber(&etup->neighbortid);
|
neighborOffno = ItemPointerGetOffsetNumber(&etup->neighbortid);
|
||||||
|
|||||||
Reference in New Issue
Block a user