Repository navigation
fix(embeddings): a set is counted once it is complete, and once for all its readers - #1288
Merged
frapercan merged 1 commit intoNov 22, 2026
Conversation
…ll its readers A prediction set is counted on its first read and the counts are kept (#1279). Two cases broke that. A set's page asks for the detail, the proteins and the terms at once, and on a set nobody had opened each of the three counted it in parallel. On the re-run count map of 211->227 (11.3 million rows, the store busy with a retrieval) they outlasted the web's proxy, which answered 500 while the API went on and kept the counts. A lock per set (pg_advisory_xact_lock) now makes the later readers wait for the first count, read the set again under the lock, and return what it kept. And nothing stopped a page opened while its set was still being written from freezing a partial count for good. A set is kept now only once the job that writes it has ended (succeeded, failed or cancelled: a set holds every row it will once its job stops) or when it names no job. While the job runs the set is counted live and returned with provisional set, nothing kept: its proteins are paged straight from its pairs, the detail says counts_provisional, and its page says the set is still being written. The sweep (summarize_prediction_sets) leaves such a set for the next sweep and says so. The set page's loading note said the counts are computed on every visit, which #1279 ended; it says now that a set is counted on its first visit.
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.
A prediction set is counted on its first read and the counts are kept
(#1279). Two cases broke that.
A set's page asks for the detail, the proteins and the terms at once, and
on a set nobody had opened each of the three counted it in parallel. On
the re-run count map of 211->227 (11.3 million rows, the store busy with
a retrieval) they outlasted the web's proxy, which answered 500 while the
API went on and kept the counts. A lock per set (pg_advisory_xact_lock)
now makes the later readers wait for the first count, read the set again
under the lock, and return what it kept.
And nothing stopped a page opened while its set was still being written
from freezing a partial count for good. A set is kept now only once the
job that writes it has ended (succeeded, failed or cancelled: a set holds
every row it will once its job stops) or when it names no job. While the
job runs the set is counted live and returned with provisional set,
nothing kept: its proteins are paged straight from its pairs, the detail
says counts_provisional, and its page says the set is still being
written. The sweep (summarize_prediction_sets) leaves such a set for the
next sweep and says so.
The set page's loading note said the counts are computed on every visit,
which #1279 ended; it says now that a set is counted on its first visit.
Checks
eslinton the set page reports the five problems the base version reports.