[scheduler] Resource accounting on Redis#2323
Draft
DiegoTavares wants to merge 12 commits into
Draft
Conversation
Scc silently drops inserts where the key already exists.
Also ensure all_sleeping_rounds is reset at the end of each full iteration
…queries Phase 1 scheduler quick wins: empty-cluster sleep, LIMIT, refresh guard - Empty-cluster sleep now configurable (cluster_empty_sleep, default 30s). - QUERY_PENDING_BY_SHOW_FACILITY_TAG capped via max_jobs_per_cluster_pass (default 20). Strict ORDER BY priority DESC; low-priority jobs deferred. - HostCacheService skips overlapping refresh ticks via an AtomicBool guard. Add V40 indexes for scheduler pending-job query GIN on layer.str_tags (array overlap), composite partial on job(pk_show, pk_facility, str_state, b_paused) WHERE PENDING/not paused, partial on layer_stat(pk_layer) WHERE int_waiting_count > 0. Plain CREATE INDEX (Flyway 5.2.0 wraps in a transaction, which Postgres rejects for CONCURRENTLY); apply with CONCURRENTLY via psql before Flyway when running against populated production tables. Drop LOWER(pk_facility) hack and rewrite QUERY_PENDING with EXISTS Scheduler-side facility id is now String (was Uuid). The dao::helpers parse_uuid path was lower-casing every facility round-trip, which forced LOWER() compares in 6 SQL sites. Cuebot writes canonical casing on insert, so a String swap removes the hack at the source. QUERY_PENDING_BY_SHOW_FACILITY_TAG rewritten to a single bookable_shows CTE plus EXISTS subquery, removing the layer ⨝ layer_stat ⨝ DISTINCT cardinality blowup. Folder cap split into outer early-out and per-layer fit inside the EXISTS.
Now shows can be moved to the scheduler using cueadmin: ``` cueadmin -show foo -setSchedulerManaged true ``` The following properties have been removed: ``` dispatcher.scheduler_manages_resources=false dispatcher.exclusion_list=show1,show2:facility.allocation,show3:facility.allocation ```
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When a proc belonging to a show managed by the Scheduler is destroyed, its core and gpu counts are sent to Redis to update the cached version of the resource accounting tables. See design/SCHED_REDIS_DECISIONS.md for more details.
96b309f to
d14e52e
Compare
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.
WIP