mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-14 08:36:54 +08:00
Added version to reduce stale reads and writes and prepare for optimistic locking
This commit is contained in:
@@ -476,10 +476,12 @@ MarkDeleted(HnswVacuumState * vacuumstate)
|
||||
ntup = (HnswNeighborTuple) PageGetItem(npage, PageGetItemId(npage, neighborOffno));
|
||||
|
||||
/* Overwrite element */
|
||||
etup->version++;
|
||||
etup->deleted = 1;
|
||||
MemSet(&etup->vec.x, 0, etup->vec.dim * sizeof(float));
|
||||
|
||||
/* Overwrite neighbors */
|
||||
ntup->version = etup->version;
|
||||
for (int i = 0; i < ntup->count; i++)
|
||||
ItemPointerSetInvalid(&ntup->indextids[i]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user