Take the build lock when dropping a vector index so a drop cannot deadlock a concurrent build - #908
Merged
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Merged
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.
Split out of #903 at review's request: it is @Floating-Y's commit, carried here unchanged with their sign-off, so that the chat terminal fix lands on its own and this change gets its own description.
vector_index::dropranDROP INDEX CONCURRENTLYwithout the session-level advisory lock thatbuildtakes, so a drop racing a build could deadlock the same way two builds did before #887. Both now go through the samelock_build/unlock_buildpair;rememberandforgetmove after the statement succeeds so the in-process cache never claims an index that the statement failed to create or remove. The connection is closed instead of returned when the unlock fails, as before.The store test
dropping_an_index_waits_for_a_buildholds the lock on one connection and checks thatdropdoes not return within 100 ms, then releases and lets it finish.🤖 Generated with Claude Code