Skip to content

Fix panic during payload index building - #4973

Merged
timvisee merged 1 commit into
devfrom
fix-payload-index-build-panic
Aug 28, 2024
Merged

timvisee merged 1 commit into
devfrom
fix-payload-index-build-panic

Conversation

@timvisee

@timvisee timvisee commented Aug 28, 2024 •

Copy link
Copy Markdown
Member

Fixes #4970

Fix a panic during payload index building.

We took a payload_index.borrow_mut() while not having exclusive access to the parameter (&self). Other actors accessing the payload index at the same time trigger a panic.

We recently implemented non-blocking payload indexing in #4941 which is where this problem was introduced. It didn't happen before because the function taking the mutable borrow enforced exclusive access on its own (with &mut self).

It turns out the borrow_mut() is obsolete now because we don't need mutability on the value anymore.

Changing the borrow_mut() to borrow() patches the problem and guarantees this cannot happen anymore.

Reproduce

This panic can be reproduced in Qdrant v1.11.1 with cargo run -r -- --drills-to-run collections_churn using coach.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

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