[TENT] Add scoped configuration validation and change planning - #4014
Open
bugkeep wants to merge 2 commits into
Open
[TENT] Add scoped configuration validation and change planning#4014bugkeep wants to merge 2 commits into
bugkeep wants to merge 2 commits into
Conversation
bugkeep
marked this pull request as ready for review
September 10, 2026 15:29
bugkeep
requested review from
00fish0,
alogfans,
chestnut-Q,
doujiang24,
dtcccc and
staryxchen
as code owners
September 10, 2026 15:29
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.
Description
TENT's immutable configuration bundles do not yet tell a caller whether a complete candidate is well-formed or which changes require a restart. This adds
planTentConfigChange(current, candidate, context), a side-effect-free validation and diff API for an initial set of fields. For example, changingrpc_server_portfrom 18080 to 28080 produceskRestartRequired, changingmerge_requestsproduceskRuntimeCandidate, and changing an uncoveredpolicyfield produceskUnsupported.This is the initial validation/planning slice of PR2 in RFC #3833, building on #3836. It complements the merged #3934: the analyzer reuses its failover defaults, while submission-time policy pinning, task handling, retries, and snapshot publication remain unchanged. The result is intended for future configuration diagnostics such as #2864.
The API:
current_statusandcandidate_statusseparately. Each input stops at its first error using the existingStatus::InvalidArgumentconvention, with the field/component and reason in the message. Inputs are not patches.config_parser.h/.cpp. Admission and preflight both callQueueLimits::validate()for reserve/capacity constraints.CHECK_STATUSpropagation.Config::toJson()to copy JSON under one lock without losing non-finite numbers through a dump/parse round trip.Initial coverage: RPC hostname/port/threads, merge/failover settings, progress worker and runtime queue enablement, queue fields consumed by
construct(), and transport enable flags. Detailed backend parameters, policy/QoS, metrics, and other uncovered fields may pass through unchanged; their additions, removals, or modifications are alwayskUnsupported. HP TCP enablement must use its nested transport object, matching its dedicated parser.valid()means that validation within this documented scope succeeded; callers must still inspect every change disposition.kRuntimeCandidateis eligibility for a future consumer protocol, not a promise of live application. This PR does not add an update entry point, assign generations, publish snapshots, probe devices, or wire the complete preflight into startup. Startup reuses the extracted checks; loading precedence, accepted RPC types/ranges/defaults, andConfig::get()fallback behavior are preserved. RPC error messages identify the field and constraint without echoing the configured value.Module
mooncake-transfer-engine)mooncake-store)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
CPU Debug build in WSL with GCC 15, CUDA/HIP disabled. All six targets passed, totaling 132 test cases. Hardware-dependent GPU/RDMA execution was not tested.
Test commands:
Test results:
config_validation_testpassed 24 tests covering defaults, alias/path handling, wrong types, overflow, non-finite numbers, cross-field constraints, build capabilities, unknown-field changes, output limits, frozen-input ownership, independent Status results for both inputs, and shared RPC parser output preservation on failure.Regression checks:
config_lifecycle_testpassed 16 tests;admission_queue_testpassed 41 tests;tent_engine_failover_e2e_testpassed 30 tests, including both #3934PolicyIsPinnedAtSubmitcases;transfer_engine_config_override_testpassed 14 tests;tent_hp_tcp_transport_config_testpassed 7 tests. Scoped pre-commit checks passed with clang-format 20.Checklist
./scripts/code_format.shThe API contract, validation scope, and limits are documented in
config_validation.h. RFC: #3833.AI Assistance Disclosure
OpenAI Codex assisted with implementation, test development/execution, and this PR description. The human submitter reviewed the code and directed reuse of the repository's existing validation routines and Status convention.