Skip to content

Take the build lock when dropping a vector index so a drop cannot deadlock a concurrent build - #908

Merged
WaylandYang merged 1 commit into
devfrom
fix/vector-index-drop-takes-the-build-lock
Sep 24, 2026
Merged

WaylandYang merged 1 commit into
devfrom
fix/vector-index-drop-takes-the-build-lock

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

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::drop ran DROP INDEX CONCURRENTLY without the session-level advisory lock that build takes, so a drop racing a build could deadlock the same way two builds did before #887. Both now go through the same lock_build / unlock_build pair; remember and forget move 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_build holds the lock on one connection and checks that drop does not return within 100 ms, then releases and lets it finish.

🤖 Generated with Claude Code

Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit a9da69c into dev Sep 24, 2026
7 checks passed
@WaylandYang
WaylandYang deleted the fix/vector-index-drop-takes-the-build-lock branch September 24, 2026 15:26
@WaylandYang WaylandYang mentioned this pull request Sep 25, 2026
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.

2 participants