fix(embed): gate embed backlog on true unembedded count, not IVF index lag#73
Open
tenequm wants to merge 1 commit into
Open
fix(embed): gate embed backlog on true unembedded count, not IVF index lag#73tenequm wants to merge 1 commit into
tenequm wants to merge 1 commit into
Conversation
…x lag After a fresh `pond copy` over S3, the destination holds already-embedded rows the IVF_SQ index has not folded yet (copy carries the vector via projection: None). The embed stage gated its progress bar on `unindexed_vector_backlog` - the index-lag count - which then read ~104,994 "unindexed" while 0 rows were actually unembedded, rendering a progress bar that looks permanently hung on a pure no-op. Gate on `embed_backlog_count` instead (search_text present, embedding_model null) read off the narrow model-id column - the true eligible-unembedded count. The 0.10.1/0.10.2 narrow-column work already made this count cheap, so there is no perf reason to gate on the coarser index-lag proxy. Drops the now unused `unindexed_vector_backlog`.
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.
Problem
After a fresh
pond copyover S3, the embed stage shows a progress bar that looks permanently hung on what is actually a no-op.Root cause:
pond copycarries already-embedded rows into the destination with the vector intact (projection: None), but the IVF_SQ vector index has not folded those rows yet. The embed stage gated its backlog onunindexed_vector_backlog- the index-lag count - so it read ~104,994 "unindexed" rows while 0 were actually unembedded. The stage then spins up a progress bar sized to ~105k that can never make progress, because there is nothing to embed.The index-lag count is a poor proxy for the embed backlog: it counts "rows the index hasn't absorbed," which after a copy is a large set of fully-embedded rows.
Approach
Gate on
embed_backlog_countinstead - the true eligible-unembedded count (search_textpresent,embedding_modelnull), read off the narrowembedding_modelcolumn. On the post-copy store this correctly reports0, so the stage stays silent (the summary'sindexesline confirms "semantic ready" downstream).The narrow-column scan was the expensive thing that originally motivated the index-lag proxy, but the v0.10.1/v0.10.2 backlog work already made
embed_backlog_countcheap (manifest-only / narrow-column read), so there is no longer any perf reason to gate on the coarser proxy.swapped(model-swap detection) is unchanged - it still drives the force/bail path, the IVF drop, and thebar_total == 0 && !swappedsilent-skip.Changes
src/main.rs:run_embed_stage_with_limitreadsstore.embed_backlog_count()unconditionally; replaces theswapped ? embed_backlog_count : unindexed_vector_backlogbranch.src/sessions.rs: removes the now-unusedStore::unindexed_vector_backlog(no other callers).Net: +9 / -23.
Validation
cargo fmt --checkcleancargo clippy --locked -- -D warningscleancargo test --locked- 235 passed, 0 failed (169 lib + 24 bin + 42 integration), incl.embed_backlog_count_tracks_eligible_unembedded_rowsandembed_worker_drains_the_backlog