Skip to content

Added delay after upsert and delete for eventual consistency #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aarshitaacharya
Copy link

@aarshitaacharya aarshitaacharya commented Jul 7, 2025

Problem

The original code was correct, but the output at line 28 was misleading in the file - docs/quick-tour/interacting-with-the-index.ipynb.
Even after calling index.delete(ids=["A"]), the fetch result still included vector "A", which was unexpected. This occurred because vector deletions in the index are not immediately consistent — the deletion may take a few seconds to propagate before being reflected in fetch results.

Solution

To ensure consistency between delete and fetch operations, I added simple time.sleep() delays after the upsert() and delete() calls. This gives the system enough time to reflect the changes before verifying the result. The core logic remains unchanged, the added delays prevent false negatives in fetch outputs.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

  1. Upsert vectors "A" and "B".
  2. Sleep briefly to allow for consistency.
  3. Verify both vectors appear in fetch results.
  4. Delete vector "A".
  5. Sleep again to ensure deletion is fully applied.
  6. Verify that "A" no longer appears in fetch results, while "B" still does.
  7. All steps pass with the added delay, confirming the issue was timing-related rather than a code logic bug.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

1 participant