Skip to content

Conversation

generall
Copy link
Member

It looks like we had a broken flush procedure in all db wrappers.

Old logic does the following:

  • accumulate updates in tmp structure in ram
  • On flush - move tmp structure in flush thread
  • Write changes from tmp structure to disk

But, what if we read from the structure in the moment after flush thread created, but before it is actually written - we can have inconsistent results.

This PR: makes a copy of changes for the thread and only removes pending updates if they are persisted.

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Member

@timvisee timvisee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timvisee timvisee merged commit 8c9687b into dev Apr 15, 2025
17 checks passed
@timvisee timvisee deleted the fix-update-wrapper branch April 15, 2025 08:48
pull bot pushed a commit to kp-forks/qdrant that referenced this pull request Apr 21, 2025
* fix flush routine for persistent wrappers

* fmt

* rollback changes for write-only wrappers

* Use retain to drop flushed items

* Rename function

---------

Co-authored-by: timvisee <tim@visee.me>
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