Repository navigation
Conversation
…dated
The dense lookup queued one chord over the whole span between the lowest and highest
row with a NULL root, 500 ids per task, all at once. A large span filled Redis; a span
of one row crashed every task ('int' object is not subscriptable) and any longer span
could not be sent at all (range is not JSON serializable). Each task also re-looked-up
every row in its range, not only the NULL ones, and the chain ended with
update_metadata, moving the table's last_updated to now: the next update_root_ids run
then skipped the roots of other rows that expired in between, leaving them stale.
It now streams the ids of rows with a supervoxel id and a NULL root, and queues small
batches as the process queue drains (batch_missing_root_ids_query, throttled), like the
sparse lookup but without its "table modified recently" check. Roots are looked up at
the table's last update, which stays as it is.
monitor_task_states polls only the tasks still pending, instead of every task every
0.2 s.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ar update Two tools, both through update_root_ids (so both write only what changed and keep the table's last_updated right): - Full re-lookup, for a table whose roots may be stale without knowing which: every row is looked up from its supervoxel id (lookup_all_root_ids). New per-table endpoint /materialize/run/lookup_all_root_ids/datastack/<ds>/table/<table>; the existing update_roots?lookup_all_root_ids=true does it for a whole datastack. - NULL roots: every update now looks up the rows with a supervoxel id and a NULL root in one chunk of their own (they used to be added to every expired-root chunk, and were skipped entirely when nothing had expired). The dense and sparse missing-root endpoints now run that update right away; the hourly and build chains no longer need the separate (gated) missing-root step. update_root_ids_workflow queues its chunk tasks with at most UPDATE_ROOT_IDS_MAX_IN_FLIGHT (default 20) unfinished at a time (run_with_limit) instead of one chord of all of them, so a full re-lookup of a large table, in 50k-row chunks, cannot flood Redis. get_new_root_ids writes only rows whose root changed. update_metadata runs only after every chunk succeeded, as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…of it A full re-lookup (lookup_all_root_ids) or a NULL fill (only_missing_roots, from the dense and sparse missing-root endpoints) is a repair: it looks roots up as of the table's last_updated (now if it has none) and leaves last_updated as it is, so the next regular update still covers everything that expired since. The NULL fill no longer searches for expired roots. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
…oot-lookup # Conflicts: # tests/test_ingest_new_annotations.py Co-authored-by: fcollman <782341+fcollman@users.noreply.github.com>
Contributor
Resolved in 77531ff by merging current master, preserving both its scoped test mocks and the root-ID repair tests. Syntax, whitespace, and secret checks passed. Pytest/Ruff were unavailable locally; CodeQL reported four existing upload API findings unchanged from master. |
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
/materialize/run/dense_lookup_root_ids/...) could not run:'int' object is not subscriptable);range is not JSON serializable);last_updatedto now. The next update then skipped roots that had expired in between.Change
Two repair tools, both through
update_root_ids, so both write only rows that changed.Both repairs leave
last_updatedalone. They look roots up as of the table'slast_updated(or as of now if the table has none) and never move it. The next regular update therefore still covers everything that expired since then.lookup_all_root_ids): every row of a table is looked up from its supervoxel id.POST /materialize/run/lookup_all_root_ids/datastack/<ds>/table/<table>.POST /materialize/run/update_roots/datastack/<ds>?lookup_all_root_ids=truedoes the same for a whole datastack.chunk_sizebatches.MISSING_ROOTS, alongside the expired roots, even when nothing expired.only_missing_roots). They do not search for expired roots.find_missing_root_ids_workflowstep.update_root_ids_workflowsends its chunk tasks through a newrun_with_limit, with at mostUPDATE_ROOT_IDS_MAX_IN_FLIGHT(default 20) unfinished at a time, instead of one chord of all of them. Each chunk task still checks theprocessqueue length before queuing each batch.get_new_root_idswrites only rows whose root changed. It no longer writes the supervoxel column back.update_metadataruns only after every chunk of a regular update succeeded, as before. A repair never runs it.monitor_task_statespolls only the tasks still pending.Testing
New tests:
OR IS NULL, the NULL-root chunk, and full-lookup id ranges, including the open last chunk;last_updatedalone;last_updated, fall back to now when there is none, and never callupdate_metadata;run_with_limitnever exceeds its limit;Full suite on fresh containers: 449 passed, 2 skipped. Ruff is clean.
🤖 Generated with Claude Code