Skip to content

[Store] Structure NoFDebugConfig environment settings - #4203

Merged
Aionw merged 2 commits into
kvcache-ai:mainfrom
bitborne:codex/nof-debug-environ-convergence
Sep 28, 2026
Merged

Aionw merged 2 commits into
kvcache-ai:mainfrom
bitborne:codex/nof-debug-environ-convergence

Conversation

@bitborne

@bitborne bitborne commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part of #3809. Extract MC_NOF_DEBUG and MC_NOF_DEBUG_INTERVAL_MS from transfer_task.cpp into a private, client-owned NoFDebugConfig and the common environment catalog. The NoF call sites retain their existing behavior: truthy tokens are case-insensitive (1, true, yes, on), invalid/absent intervals use 1000 ms, and each value is cached independently on its first use. The existing NoF QoS and worker settings remain outside this PR.

Raw strings intentionally preserve the old strtol syntax, including accepted leading whitespace and rejected trailing whitespace, without adding warnings or changing the public API. This follows the single-owner boundaries of merged #4165 and #4166. Open #4171 and #3424 also edit nearby NoF code but do not own these two debug variables; #4179 moves the client source layout. Any integration conflicts can be addressed if those PRs merge first.

Module

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

Type of Change

  • Refactor

How Has This Been Tested?

Test commands:

cmake --build build/config-check --target nof_debug_config_test --parallel 231
ctest --test-dir build/config-check -R '^nof_debug_config_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/nof_debug_config.cpp mooncake-store/src/config/nof_debug_config.h mooncake-store/src/transfer_task.cpp mooncake-store/tests/CMakeLists.txt mooncake-store/tests/nof_debug_config_test.cpp

Test results:

  • Unit tests pass for the new NoF debug configuration.
  • Integration tests pass (if applicable)
  • Manual testing done (describe below)

The new tests first failed with the default-only implementation, then passed after the configuration extraction. NoF-enabled compilation and integration should be validated in the NoF CI job.

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 change: existing opt-in values and behavior remain unchanged.

AI Assistance Disclosure

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

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

Signed-off-by: Schatten <czhengt@qq.com>

struct NoFDebugConfig {
bool enabled = false;
int interval_ms = 1000;

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.

std::chrono::milliseconds

bool enabled = false;
int interval_ms = 1000;

static bool ReadEnabledFromEnvironment();

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.

Visibility issue, only part of those static method need to be public.

Signed-off-by: Schatten <czhengt@qq.com>
@Aionw
Aionw merged commit 41ae8cf into kvcache-ai:main Sep 28, 2026
49 of 51 checks passed
LujhCoconut added a commit to LujhCoconut/Mooncake that referenced this pull request Oct 9, 2026
Resolve conflicts between the NoF/SPDK decoupling and mainline work:

- Env-var structuration PRs (kvcache-ai#4166/kvcache-ai#4170/kvcache-ai#4203): keep the neutral NoF
  naming/refactor while adopting the client-owned config structs
  (NoFDebugConfig, NoFWorkerPoolConfig, FilereadWorkerPoolConfig); QoS
  byte-limit vars stay in transfer_task.cpp, matching main (open kvcache-ai#4171).
- kvcache-ai#3665 embedded master + P2PHANDSHAKE metadata resolution compose with the
  added nof_initiator injection in Client::Create.
- kvcache-ai#4070 TENT native API layered onto the refactored TransferSubmitter.
- kvcache-ai#3717 (ShmHelper/receiver shm SPDK registration) is ported from the deleted
  SpdkWrapper singleton onto the NVMeoFInitiator interface and the
  process-global NofPageRegistry: registrations normalize to 2MB pages with
  per-page refcounts, -EBUSY pages are absorbed as external, and a failed
  Register owns no registration. ShmHelper's singleton is now deliberately
  leaked so exit-time cleanup can never touch a torn-down registry/env; the
  SpdkEnvGuard process pin makes the old construction-ordering hack
  unnecessary.
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