mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4360] [RFC]: [Store] Phase 2 Configuration Ownership and Compatibility Plan #1093
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#1093
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bitborne on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4360
Changes proposed
Context and goal
Mooncake Store currently assembles Master configuration across flat fields, file parsing, gflags, environment fallbacks, and HA/non-HA startup paths. A reader must trace
master.cppand several consumers to learn who owns a setting, which source wins, and when it is checked. That makes a seemingly small configuration change easy to apply to only one startup path.This RFC continues the configuration direction in #2694 and the phased work in #3809. The immediate goal is one typed, component-owned configuration per coherent setting group, resolved once at startup and passed to its consumers. It is an internal ownership refactor, not a new public configuration schema or a behavior change.
Scope and ownership
MasterConfig.MasterConfigmay temporarily aggregate the typed configs while existing constructors and HA/non-HA paths are migrated.FLAGS_*, file keys, or environment lookups.Resolution contract
For each field, start with the current default, apply an existing file key when present, then apply an explicitly supplied CLI flag. An unspecified flag must not erase a file value. Where an existing environment variable is a fallback, apply it only under its current condition (for example, pod identity only when the effective value is empty). Preserve deprecated aliases, warning text/conditions, special zero or empty meanings, and failure timing unless a PR calls out a separately reviewed behavior change.
The loader's interface follows the pattern already in use:
XConfigdeclares domain types and defaults close to the owner (std::chrono::seconds/millisecondsfor durations, for example). The loader reads the existing flat file keys, merges explicit overrides, validates the effective result, and returns a value. Each default is declared once, as a named constant on the owner config, and the correspondingDEFINE_*gflags default references that constant instead of repeating the literal, so a later default change cannot silently diverge between the file default, the config default, and the flag default. It must not silently convert invalid signed values to unsigned or narrow ports/sizes. If a group has legacy aliases or a conditional fallback, document and test their exact order rather than forcing a generic merge helper that changes semantics. OS-dependent resolution and side effects can stay at startup assembly until a focused design places them behind a testable boundary.What changes at the call site
This deliberately allows a narrow PR to change ownership without rewriting every constructor at once. It does not authorize leaving a second parser for the same group in
InitMasterConforLoadConfigFromCmdline: once a group is migrated, both old assignments should be removed, and both startup paths should consume the same resolved value. The temporary aggregation is a forwarding adapter, not another source of truth.Worked example for a future PR: RPC server bind settings
The RPC listener's
rpc_port,rpc_thread_num,rpc_address, andrpc_interfaceare a coherent future owner group, separate from the RPC connection timeout/TCP settings. A focused PR could introduceRpcBindBootstrapConfigandRpcBindCommandLineOverrides, resolve the current flat keys once, then forward the result through the existing HA and non-HA server construction paths. The public flags and file keys stay unchanged.This group has nontrivial compatibility rules: deprecated
port/max_threadsaliases, preference for positiverpc_port/rpc_thread_num, the hardware-concurrency fallback when no config file is provided, andrpc_interfaceoverridingrpc_addressafter interface lookup. The PR must pin the current behavior with tests before moving the logic. Interface lookup and its diagnostics may remain in startup assembly in that PR; a pure loader need not perform network-interface I/O. A proposal to change alias precedence or defaults is out of scope for that ownership PR.Reusable PR change template
Each subsequent PR should cover one coherent owner group, with this reviewable shape:
XConfigin the owner's config header and aResolveXConfigloader with an optional-valued override struct. Use semantic types where they prevent unit mistakes; keep conversions and validation at the boundary. Keep unrelated settings, public key renames, and broad constructor rewrites out of the PR.master.cpp, call the resolver once, remove the group's old flat parsing/assignments, and forward the typed value to every relevant adapter/consumer. Update build registration only if a new source file requires it.The PR is complete when every setting in its group has one effective resolved value, all existing input forms still work, and no consumer reads the old field or source independently. A failed compatibility case blocks the ownership migration; it is not deferred to a later cleanup PR.
Phase boundary and risks
The main risks are split ownership during migration, changed alias/fallback precedence, silent narrowing or unit conversion, and drift between HA and non-HA wiring. The one-resolver rule, the shared default constants, and the compatibility tests above are the acceptance checks for those risks. PRs touching shared
master.cppmay need sequencing or conflict resolution, but should not broaden their ownership boundary to absorb adjacent settings.Before submitting a new issue...
@github-actions[bot] commented on GitHub (Sep 28, 2026):
Thanks for opening this issue, @bitborne!
177341921A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide