Skip to content

[Store] Structure DistributedStorageConfig environment settings - #3763

Merged
Aionw merged 2 commits into
kvcache-ai:mainfrom
bitborne:store/distributed-storage-environ-convergence
Sep 2, 2026
Merged

Aionw merged 2 commits into
kvcache-ai:mainfrom
bitborne:store/distributed-storage-environ-convergence

Conversation

@bitborne

@bitborne bitborne commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

This continues the environment configuration convergence from #3408 and #3525 for DistributedStorageConfig. It groups the existing environment-variable definitions in mooncake-common, moves configuration loading, validation, and formatting out of the distributed-storage backend implementation, and adds focused configuration tests.

The refactor preserves the existing defaults, preferred and legacy variable precedence, parsing behavior, diagnostics, validation rules, and read timing. It also keeps the existing silent fallback for empty eviction-watermark values.

#3714 also touches DistributedStorageConfig to add OSS support. This PR does not change adapter behavior; if #3714 lands first, its validation changes will be preserved when this branch is rebased.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Test commands:

cmake --build build --target distributed_storage_config_test dfs_posix_test master_service_test -j64
ctest --test-dir build --output-on-failure -R '^(distributed_storage_config_test|dfs_posix_test)$'
build/mooncake-store/tests/master_service_test --gtest_filter='MasterServiceTest.Dfs*'
./scripts/code_format.sh --base kvcache/main --changed-lines --check
uv run --no-project --with pre-commit==3.7.1 pre-commit run --files mooncake-common/include/environment_variables.h mooncake-store/src/CMakeLists.txt mooncake-store/src/config/distributed_storage_config.cpp mooncake-store/src/storage/distributed/distributed_storage_backend.cpp mooncake-store/tests/CMakeLists.txt mooncake-store/tests/dfs_posix_test.cpp mooncake-store/tests/distributed_storage_config_test.cpp

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

The configuration and DFS POSIX tests passed 2/2, the filtered Master DFS tests passed 2/2, and all touched-file pre-commit hooks passed.

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

AI Assistance Disclosure

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

I used Codex to inspect the existing configuration patterns, help implement and review the refactor, and run focused formatting, build, and test checks. I reviewed all changed lines.

@@ -0,0 +1,143 @@
#include "storage/distributed/distributed_storage_backend.h"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definition for distributed storage backend config should be extracted out of distributed_storage_backend.h and become a seperated file under src/config.

The dependency graph must be storage_backend -> storage_backend_config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted DistributedStorageConfig into a separate config header, with its implementation under src/config. The dependency is now DistributedStorageBackend -> DistributedStorageConfig, and the config layer no longer depends on the backend header. The declaration is kept under the public include tree because the backend header stores the config by value.

@bitborne
bitborne force-pushed the store/distributed-storage-environ-convergence branch from 02c862c to 84f2de6 Compare August 31, 2026 09:48

@Aionw Aionw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Schatten <czhengt@qq.com>
@bitborne
bitborne force-pushed the store/distributed-storage-environ-convergence branch from 84f2de6 to 8a50872 Compare September 1, 2026 07:55
@Aionw
Aionw merged commit dfe977f into kvcache-ai:main Sep 2, 2026
25 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