Repository navigation
Remove obsolete CustomResourceManager in favor of WorkloadResourceManager - #108286
Conversation
…ager CustomResourceManager was the original config-XML-based resource scheduler: scheduling hierarchies were described in the server config via the `resources` and `workload_classifiers` sections. It has been superseded by WorkloadResourceManager, which builds the same hierarchies from SQL `CREATE RESOURCE` / `CREATE WORKLOAD` entities, so the config-based path is redundant. This removes: - `CustomResourceManager` and `ClassifiersConfig`, and the dispatcher entry in `createResourceManager`. - The legacy config-string node-construction machinery that only existed to support it: `SchedulerNodeFactory`, `registerSchedulerNodes`, the per-node `register*` functions, every `(config, prefix)` constructor (down through `SchedulerNodeInfo`, `ISchedulerNode` and the `ITimeSharedNode` / `ISchedulerConstraint` / `ISchedulerQueue` / `ISpaceSharedNode` bases), and `emptyConfig`. The scheduler node classes themselves are unchanged and are still created programmatically by `WorkloadNode`. - The now-dead `equals(ISchedulerNode *)` configuration-diff virtual (used only by `CustomResourceManager`) and its overrides, plus the unused `IResourceManager::updateConfiguration`. - The `CUSTOM_RESOURCE_MANAGER` thread name. The `resources` and `workload_classifiers` config sections are now obsolete; the server logs a warning and ignores them on startup/reload. Unit tests (`ResourceTest` helper and the time-shared node gtests) now build nodes via `SchedulerNodeInfo` constructors instead of XML snippets. The `test_scheduler` integration suite is renamed to `test_scheduler_io` (it is IO-specific, exercising `READ DISK` / `WRITE DISK` resources, matching the `test_scheduler_*` naming). Its config-based tests are reworked to define resources and workloads via SQL; tests already covered by existing SQL-based tests were dropped rather than duplicated. Documentation: the config-based `resources` hierarchy and the deprecated workload classifiers sections are removed from workload-scheduling.md. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
For now, this is based on the |
…e/disk names - `createResourceManager` now returns `WorkloadResourceManager` directly instead of wrapping it in `ResourceManagerDispatcher`, since it is the only `IResourceManager` implementation left. `WorkloadResourceManager::Classifier` already implements the full classifier interface; its unknown-workload branch now throws `RESOURCE_ACCESS_DENIED` (as the dispatcher did) instead of the previously dead `RESOURCE_NOT_FOUND`, preserving the user-visible error. - Integration tests: keep the original resource names (`network_read` / `network_write`) and disk / storage-policy names (`s3`, `s3_no_fake_tx`, ...) instead of renaming them when moving from XML to SQL configuration. The disks simply no longer carry `read_resource` / `write_resource` bindings; resources are attached via `CREATE RESOURCE ... (READ/WRITE DISK ...)`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [7bf9825] Summary: ✅
AI ReviewSummaryThis PR removes the legacy XML-driven PR Metadata
Findings
Tests
Final Verdict
|
FifoQueue, SemaphoreConstraint and ThrottlerConstraint have constructors that are callable with a single argument, which the google-explicit-constructor clang-tidy check flags as an error under -warnings-as-errors (Build (arm_tidy)). Mark them explicit, matching the sibling FairPolicy/PriorityPolicy nodes in the same directory. Co-Authored-By: Claude Opus 4.8 <[email protected]>
test_merge_workload_change and test_mutation_workload_change queried system.scheduler with "path ilike '%/<workload>'", expecting the fifo node's path to end at the workload node. With CustomResourceManager removed, scheduling runs on the SQL-backed WorkloadResourceManager where the fifo node sits below the workload node, so the predicate matched nothing and int('') raised ValueError. Add the trailing /% to match the fifo node under the workload, consistent with the sibling test_merge_workload / test_mutation_workload tests.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@groeneai, please investigate two unrelated failures blocking this PR and provide fixes in separate PRs:
If fixes are already in progress, please link them here. |
|
@serxa Confirmed: both failures are unrelated to the scheduling refactor (no type-system or replication-protocol changes in this PR), and fixes are already in progress. 1. Stress test (amd_tsan), STID 1611-447a
2. Integration (amd_asan_ubsan, db disk, old analyzer), test_parallel_quorum_actually_quorum
Nothing for you to do here. Will keep both moving. |
|
@groeneai, new unrelated failure on head 8bb9269: Stress test (amd_asan_ubsan) and Upgrade check (amd_release) both fail with STID Jobs: https://github.com/ClickHouse/ClickHouse/actions/runs/28305084057/job/83864745561 and https://github.com/ClickHouse/ClickHouse/actions/runs/28305084057/job/83867191030 |
|
@serxa Confirmed: STID 1499-22cb is the known #91119 family, unrelated to the CustomResourceManager removal. Mechanism (from the amd_asan_ubsan stack): Not caused by this PR: it is a resource-scheduling refactor with no analyzer, type-system, or aggregate changes. The same STID has hit 6+ unrelated PRs over the last month, so it is a pre-existing trunk defect surfaced by the fuzzer over In-flight fix: #104350 (open). It stops the analyzer from wrapping the aggregate-argument reference as Nullable across the LAMBDA -> QUERY scope chain; its regression test |
…er_io The suite was renamed test_scheduler -> test_scheduler_io in this PR, but ci/jobs/scripts/integration_tests_configs.py still keyed its duration under the old path, making the renamed suite zero-cost and unbalancing test batches. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
| stay_alive=True, | ||
| main_configs=[ | ||
| "configs/storage_configuration.xml", | ||
| "configs/resources.xml", |
There was a problem hiding this comment.
The migration path removed by this PR is untested now. After the suite stopped loading the legacy resources / workload_classifiers config, the only config coverage left here is resources_and_workloads, so we no longer exercise the new contract that the obsolete sections are only warned about and ignored on startup/reload. Please add a focused integration case for the legacy sections that reloads config, verifies no scheduler entities are created from them, and confirms the server stays up.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 153/161 (95.03%) · Uncovered code |
|
📊 Cloud Performance Report
This PR removes the legacy config-based resource scheduling path (CustomResourceManager, the scheduler-node factory, and workload classifiers) and replaces it with a deprecation warning; the public and private diffs are identical aside from a test rename. None of this runs on the query-execution hot path for a standard ClickBench run with no custom resources configured, so all four flagged deltas are off-path. The Q4 and Q15 ~-20% improvement-looking deltas and the Q30/Q31 +15-20% regression-looking deltas are run-to-run variance, not real PR effects — Q4 was already correctly suppressed to no-change inside master's variance band, and the Q15 improvement is downgraded to not-sure for the same reason. Q30 and Q31 sit on an intrinsically noisy baseline and stay not-sure. clickbenchFlagged queries (3 of 43)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
…smanager Remove obsolete CustomResourceManager in favor of WorkloadResourceManager
Removes the obsolete config-XML-based
CustomResourceManagerin favor of the SQL-basedWorkloadResourceManager.CustomResourceManagerdescribed scheduling hierarchies through the server config (resourcesandworkload_classifierssections).WorkloadResourceManagerbuilds the same hierarchies fromCREATE RESOURCE/CREATE WORKLOADentities, so the config-based path is redundant. This removes the manager, the legacy config-string node-construction machinery that only existed to support it (SchedulerNodeFactory,registerSchedulerNodes, the per-noderegister*functions, every(config, prefix)constructor down throughSchedulerNodeInfo/ISchedulerNode/the time-shared bases, andemptyConfig), the now-deadequals(ISchedulerNode *)config-diff virtual, the unusedIResourceManager::updateConfiguration, and theCUSTOM_RESOURCE_MANAGERthread name. The scheduler node classes themselves are unchanged and are still created programmatically byWorkloadNode.The
resourcesandworkload_classifiersconfig sections are now obsolete: the server logs a warning and ignores them on startup/reload. Node-level unit tests now construct nodes viaSchedulerNodeInfoinstead of XML snippets. Thetest_schedulerintegration suite is renamed totest_scheduler_io(it is IO-specific) and its config-based tests are reworked to define resources/workloads via SQL (those already covered by existing SQL-based tests were dropped, not duplicated). The config-basedresourceshierarchy and deprecated workload classifiers sections are removed from the documentation.Related: #82414
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Removed the config-based workload scheduling configuration (the
resourcesandworkload_classifiersserver config sections). UseCREATE RESOURCEandCREATE WORKLOADqueries instead. The obsolete config sections are ignored with a warning.Version info
26.7.1.776(included in26.7and later)