Skip to content

Conversation

@alonre24
Copy link
Collaborator

@alonre24 alonre24 commented May 7, 2023

Describe the changes in the pull request

Let the capacity of idToLabel in flat index be tight to the size (practically cherry-pick from #362).
This also requires changing a bit of the logic of updating pending insert job ids after removing a vector from the flat buffer. Until now, we accessed the (previous) last id in idToLabel AFTER the removal and swap. However, at that time this position is no longer valid (since we decreased the idToLabel size during the deletion), and now it can even cause a segmentation fault since we deallocate the last block upon deleting the last vector of the block.
The fix includes accessing the last id in idToLabel to get the relevant label BEFORE the deletion.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

…s requires changing a bit the logic of updating jobs id after removing a vector from flat buffer and swap ids.
@alonre24 alonre24 requested a review from DvirDukhan May 7, 2023 10:51
@alonre24 alonre24 changed the title idToLabel in flat index - shrink to fit and avoid invalid access idToLabel in flat index - shrink to fit and avoid invalid access MOD-5212 May 7, 2023
@alonre24 alonre24 merged commit 2e0098b into feature_HNSW_tiered_index May 7, 2023
@alonre24 alonre24 deleted the tiered_index_fix_update_last_id_insert_job branch May 7, 2023 15:56
meiravgri pushed a commit that referenced this pull request May 8, 2023
…s requires changing a bit the logic of updating jobs id after removing a vector from flat buffer and swap ids. (#367)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants