Fix transfers may lock shard holder for too long#8373
Merged
Conversation
6 tasks
Member
Author
|
Fix opened in #8374 |
…8374) * [ai] Detach shard holder lock from sending update batch * Fix clippy warning * Move stream records delay up to sleep in the middle of the batch * remove unused code --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
Member
Author
generall
approved these changes
Mar 13, 2026
agourlay
approved these changes
Mar 13, 2026
generall
added a commit
that referenced
this pull request
Mar 26, 2026
* Add basic test that shows shard holder is locked for too long * Rework test, move into stream records test * Fix typos * Don't lock shard holder for a long time in stream records transfer (#8374) * [ai] Detach shard holder lock from sending update batch * Fix clippy warning * Move stream records delay up to sleep in the middle of the batch * remove unused code --------- Co-authored-by: Andrey Vasnetsov <[email protected]> --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
KShivendu
pushed a commit
that referenced
this pull request
Mar 30, 2026
* Add basic test that shows shard holder is locked for too long * Rework test, move into stream records test * Fix typos * Don't lock shard holder for a long time in stream records transfer (#8374) * [ai] Detach shard holder lock from sending update batch * Fix clippy warning * Move stream records delay up to sleep in the middle of the batch * remove unused code --------- Co-authored-by: Andrey Vasnetsov <[email protected]> --------- Co-authored-by: Andrey Vasnetsov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shard transfers may hold a shard holder lock for a very long time, which can cascade into blocking many operations and eventually freezing the whole cluster.
Some side effects we've seen in real clusters include unresponsive nodes, broken consensus and downtime.
Since we've implemented
prevent_unoptimizedand the update queue this is a lot more likely to happen.For example, the last batch of a stream records transfer may block here for a very long time because the last batch sends with
wait=true, which holds a shard holder read lock for all that time:qdrant/lib/collection/src/shards/transfer/stream_records.rs
Lines 136 to 163 in f91e217
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --workspace --all-featurescommand?Changes to Core Features: