Skip to content

[Store][Bugfix] Fix DFS sync client test retry failure - #4781

Merged
stmatengss merged 1 commit into
kvcache-ai:mainfrom
RuixiangMa:fix/dfs-sync-client-test-retry-failure
Oct 20, 2026
Merged

stmatengss merged 1 commit into
kvcache-ai:mainfrom
RuixiangMa:fix/dfs-sync-client-test-retry-failure

Conversation

@RuixiangMa

@RuixiangMa RuixiangMa commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes the existing DfsOnlyBatchFailureOnlyRevokesFailedKey test, which failed because its injected DFS write failure persisted beyond the intended operation.

Root cause

The test adapter failed every write from the configured call onward. The DFS backend retries a failed POSIX write once after reopening the file descriptor, so the injected failure affected both the original write and its internal retry. It also caused the test’s later, independent Put retry to fail, contrary to the scenario the test intends to verify.

Changes

  • Preserve the persistent failure behavior so the batch write and its internal reopen retry both fail as intended.
  • Add ClearWriteFailure() and call it immediately after BatchPut returns, before checking that a later Put can reuse the key.
  • Keep the change limited to test code; no production behavior changes.

Testing

  • DfsOnlyBatchFailureOnlyRevokesFailedKey passes.
  • BatchDfsFailureOnlyRevokesFailedKey passes.
  • DfsMetricsCountWriteFailureSeparatelyFromOps passes.

Suggested Merge Priority

  • P0 — Urgent: Critical security vulnerability, data loss/corruption, or widespread production outage requiring immediate action
  • P1 — High: Significant correctness or stability issue in existing functionality, or a regression blocking users without a practical workaround
  • P2 — Normal: Routine bug fix, validated performance/compatibility improvement, or new feature for a confirmed use case
  • P3 — Low: Experimental feature, optional enhancement, refactoring, or cleanup with no urgent user impact

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • 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:

# Example: bash scripts/run_ci_test.sh

Test results:

  • Unit tests pass
  • Integration tests pass (if applicable)
  • 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

AI Assistance Disclosure

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

Signed-off-by: Lancer <maruixiang6688@gmail.com>
@RuixiangMa
RuixiangMa force-pushed the fix/dfs-sync-client-test-retry-failure branch from 2f2ccdd to e223960 Compare October 19, 2026 23:13

@he-yufeng he-yufeng 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.

Verified this in a Linux container (ubuntu 22.04, mooncake-store tests): DfsOnlyBatchFailureOnlyRevokesFailedKey passes with the change, and the full dfs_sync_client_test suite goes 16 passed / 2 environment-skipped (the two checksum tests skip for lack of a DFS endpoint here, same as before).

The disarm placement and ClearWriteFailure helper are correct: fail_write_call_ = -1 defeats the fail > 0 guard, and clearing right after the failing batch leaves the retry leg modeling a cleared transient fault, which is the scenario under test.

One nit: the deleted comment block above the fail > 0 guard was load-bearing documentation — it explains why the injector is persistent at all (a one-shot failure would be masked by the backend's reopen-retry, so only a persistent fault surfaces to the caller). With it gone, the next person touching this adapter has to rediscover that. Keeping it (or moving it next to ClearWriteFailure) would make the fix complete.

For disclosure: I independently opened #4785 with the same fix last night before noticing this one (identical mechanism, existing FailWriteCall(-1) instead of a new helper). Closing mine in favor of this earlier one.

@fcczzz fcczzz 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, the fix correctly clears the injected fault before the independent retry.

One non-blocking suggestion: please retain the existing comment in WriteAt explaining why failures must persist across the backend’s reopen retry. That context is still relevant and helps prevent accidentally changing the injector back to a single-call failure.

@stmatengss
stmatengss merged commit 3eabbd8 into kvcache-ai:main Oct 20, 2026
27 checks passed
zxpdemonio added a commit to zxpdemonio/Mooncake that referenced this pull request Oct 21, 2026
…20261021

* upstream/main: (507 commits)
  [Reshard] Plan Store KV reuse across TP, PP and host layouts (kvcache-ai#4762)
  [Store] Walk tenants through shard-backed cursors and build the removes on them (kvcache-ai#4796)
  [Store-RS][Bugfix] Match TENT Request Layout to the C ABI (kvcache-ai#4732)
  [TransferEngine] Recover auto GID after data-path retry exhaustion (kvcache-ai#4290)
  [Store] Add the namespace layer over the object route (kvcache-ai#4721)
  [Store] Fix silent loss of offload keys deferred to the ungrouped pool (kvcache-ai#3006) (kvcache-ai#3009)
  [Store] Remove redundant alignment headroom from DFS shard allocation (kvcache-ai#4753)
  [CI/Build] Gate ROCm hardware tests and bound nightly Docker builds (kvcache-ai#4750)
  [Bugfix][Store] Fix double-counting of segment OpLog metrics in OpLogApplier (kvcache-ai#4771)
  [Store] Skip hot-cache writeback for device-resident read destinations (kvcache-ai#4764)
  [Reshard] Add bounded in-flight execution for weight transfers (kvcache-ai#4628)
  [Store] Avoid racing with detached hot-cache fills during key scans (kvcache-ai#4334)
  [Store] HA: drain the master on SIGTERM/SIGINT before exit (part 1 of kvcache-ai#4710) (kvcache-ai#4745)
  TENT: report a notification the receiver could not take (kvcache-ai#4754)
  [Store] Reach object metadata through a per-key accessor contract (kvcache-ai#4717)
  [Store][Bugfix] Fix DFS sync client test retry failure (kvcache-ai#4781)
  [Wheel] Keep integer dtype for typed_ragged rows when a row is an empty list (kvcache-ai#4611)
  [Doc] Sync README news onto the docs homepage (kvcache-ai#4767)
  [CI] remove stale Torch version binding after PG JIT (kvcache-ai#4760)
  [TransferEngine] Add buffer-protocol and page-gathered batch transfer APIs (kvcache-ai#4763)
  ...
zxpdemonio added a commit to zxpdemonio/Mooncake that referenced this pull request Oct 21, 2026
…-ranges-20261021

* upstream/main: (394 commits)
  [Reshard] Plan Store KV reuse across TP, PP and host layouts (kvcache-ai#4762)
  [Store] Walk tenants through shard-backed cursors and build the removes on them (kvcache-ai#4796)
  [Store-RS][Bugfix] Match TENT Request Layout to the C ABI (kvcache-ai#4732)
  [TransferEngine] Recover auto GID after data-path retry exhaustion (kvcache-ai#4290)
  [Store] Add the namespace layer over the object route (kvcache-ai#4721)
  [Store] Fix silent loss of offload keys deferred to the ungrouped pool (kvcache-ai#3006) (kvcache-ai#3009)
  [Store] Remove redundant alignment headroom from DFS shard allocation (kvcache-ai#4753)
  [CI/Build] Gate ROCm hardware tests and bound nightly Docker builds (kvcache-ai#4750)
  [Bugfix][Store] Fix double-counting of segment OpLog metrics in OpLogApplier (kvcache-ai#4771)
  [Store] Skip hot-cache writeback for device-resident read destinations (kvcache-ai#4764)
  [Reshard] Add bounded in-flight execution for weight transfers (kvcache-ai#4628)
  [Store] Avoid racing with detached hot-cache fills during key scans (kvcache-ai#4334)
  [Store] HA: drain the master on SIGTERM/SIGINT before exit (part 1 of kvcache-ai#4710) (kvcache-ai#4745)
  TENT: report a notification the receiver could not take (kvcache-ai#4754)
  [Store] Reach object metadata through a per-key accessor contract (kvcache-ai#4717)
  [Store][Bugfix] Fix DFS sync client test retry failure (kvcache-ai#4781)
  [Wheel] Keep integer dtype for typed_ragged rows when a row is an empty list (kvcache-ai#4611)
  [Doc] Sync README news onto the docs homepage (kvcache-ai#4767)
  [CI] remove stale Torch version binding after PG JIT (kvcache-ai#4760)
  [TransferEngine] Add buffer-protocol and page-gathered batch transfer APIs (kvcache-ai#4763)
  ...
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.

4 participants