Repository navigation
A write does not queue a vector index build while one for the same table and dims is running - #44
Merged
Merged
Conversation
…ble and dims is running Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
gedaiu
added a commit
to re-cinq/lore
that referenced
this pull request
Oct 27, 2026
Pins `0.1.0-re.26` (`sha256:e02877d8…`), which adds re-cinq/utopia#44 on top of re.25. With re.25, every write queued another index build while one was already running. Each queued build took a worker slot and waited on the build lock: 53 slots out of 64 in production within about 30 minutes, which starves ingestion. re.26 queues no new build while one for the same table and dims is queued or running. No new migration and no database restart. Only the app pod is recreated, and it requeues the waiting jobs on start; those then exit as soon as their index exists. Related: re-cinq/utopia#44, #3727 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Since re.25 (#43), a 3072-dim base gets index builds, and a build of 464k entity profiles runs for over an hour.
vector_index::requestskipped a duplicate only while one was queued. Once a worker claimed the build, every write queued another. Each one took a worker slot and polled the build's advisory lock until the first finished: in production, 43 connections were waiting within 15 minutes, eating into the 64 job slots that ingestion needs.requestnow uses the existingjobs::enqueue_unless_pendingwith no delay, so a queued or running build blocks a new one. That function's contract is that the job takes in what changed while it ran, andCREATE INDEX CONCURRENTLYdoes, because rows written during the build are indexed. A build leftrunningby a dead process is requeued by the worker on start, so it cannot block forever.the_first_write_of_a_dimension_queues_one_buildnow marks the queued build running and checks that another write queues nothing. It fails without the change.🤖 Generated with Claude Code