Skip to content

[Store] Structure HaClusterNamespaceConfig environment settings - #4165

Merged
Aionw merged 1 commit into
kvcache-ai:mainfrom
bitborne:codex/ha-cluster-namespace-environ-convergence
Sep 17, 2026
Merged

Aionw merged 1 commit into
kvcache-ai:mainfrom
bitborne:codex/ha-cluster-namespace-environ-convergence

Conversation

@bitborne

@bitborne bitborne commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Description

Part of #3809. Move the three Mooncake Store HA backend reads of MC_STORE_CLUSTER_ID into a private, master-owned HaClusterNamespaceConfig and register the variable in the common environment catalog.

The existing explicit namespace argument still takes precedence without reading the environment. For an absent or empty variable, the default remains mooncake_cluster; nonempty values are preserved verbatim, and each constructor resolves its own namespace. The Redis-disabled backend behavior and the independently owned client-metric label reader remain unchanged. No public API changes.

This is a single-owner extraction, following the scope and private-config pattern of merged PRs #3872 and #4036.

Module

  • Mooncake Store (mooncake-store)
  • Common (mooncake-common)

Type of Change

  • Refactor

How Has This Been Tested?

Test commands:

cmake --build build --parallel 227 --target ha_cluster_namespace_config_test redis_snapshot_catalog_store_test high_availability_test mooncake_store_master_objects
ctest --test-dir build -R '^(ha_cluster_namespace_config_test|redis_snapshot_catalog_store_test|high_availability_test)$' --output-on-failure
./scripts/code_format.sh --check --staged
pre-commit run --files mooncake-common/include/environment_variables.h mooncake-store/src/CMakeLists.txt mooncake-store/src/config/ha_cluster_namespace_config.cpp mooncake-store/src/config/ha_cluster_namespace_config.h mooncake-store/src/ha/leadership/backends/etcd/etcd_leader_coordinator.cpp mooncake-store/src/ha/leadership/backends/redis/redis_leader_coordinator.cpp mooncake-store/src/ha/snapshot/catalog/backends/redis/redis_snapshot_catalog_store.cpp mooncake-store/tests/CMakeLists.txt mooncake-store/tests/ha_cluster_namespace_config_test.cpp mooncake-store/tests/ha/snapshot/catalog/backends/redis/redis_snapshot_catalog_store_test.cpp

Test results:

  • Unit tests pass: all 3 focused CTest targets passed; the Redis snapshot constructor compatibility tests also passed before the extraction.
  • Integration tests pass (if applicable): no external Redis/etcd service was required for this focused run.
  • Manual testing done (describe below)

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

No documentation update: the supported environment behavior and API are unchanged.

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Codex assisted with ownership analysis, implementation, RED-to-GREEN focused tests, build/format/hook verification, and review. The human submitter will review every changed line and is responsible for the change end to end.

@Aionw
Aionw merged commit 0d63529 into kvcache-ai:main Sep 17, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants