Repository navigation
[fix] Fix MooncakeStore SSD offload hard_pin detection and master lease TTL - #254
Merged
Merged
Conversation
…se TTL Two bugs prevented MooncakeStore SSD offload from reclaiming DRAM under the default tq.init() configuration: 1. MooncakeStoreClient checked isinstance(offload_conf, dict) when deciding whether to auto-disable replica_config.with_hard_pin. Because tq.init() passes an OmegaConf DictConfig, offload_enabled always evaluated to False and objects remained hard-pinned, preventing eviction. Use Mapping instead. 2. initialize_mooncake_storage() unconditionally passed -default_kv_lease_ttl=999999 (~16.7 min), -default_kv_soft_pin_ttl=999999, and --allow_evict_soft_pinned_objects=false to mooncake_master. Even when offload flushed objects to SSD, Mooncake refused to reclaim their DRAM replicas until the 999999 ms lease expired, causing NO_AVAILABLE_HANDLE (-200) once cumulative writes exceeded cluster DRAM. Remove these obsolete overrides and rely on Mooncake's default lease TTL; non-offload eviction is already prevented by with_hard_pin=True and eviction_ratio=0.0. Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Collaborator
Author
|
CC @huniu20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs that prevented
MooncakeStoreSSD offload (backend.MooncakeStore.offload.enabled: true) from evicting DRAM replicas under the defaulttq.init()configuration, causing writes exceeding cluster DRAM to fail withNO_AVAILABLE_HANDLE (-200).Root Cause
hard_pinauto-disable failed on OmegaConfDictConfig(transfer_queue/storage/clients/mooncake_client.py):tq.init()passes an OmegaConfDictConfigtoMooncakeStoreClient. Checkingisinstance(offload_conf, dict)always evaluated toFalseforDictConfig, sooffload_enabledstayedFalseandhard_pin: nullresolved towith_hard_pin = True. Hard-pinned objects are never evicted by Mooncake (Eviction: 0/0).Hardcoded
-default_kv_lease_ttl=999999blocked DRAM reclamation (transfer_queue/storage/bootstrap/mooncake_bootstrap.py):initialize_mooncake_storage()unconditionally passed-default_kv_lease_ttl=999999(~16.7 minutes),-default_kv_soft_pin_ttl=999999, and--allow_evict_soft_pinned_objects=falsetomooncake_master. Even whenhard_pinwas explicitly set tofalseandmooncake_clientflushed buckets to SSD,mooncake_masterrefused to release the DRAM replicas until the 999,999 ms lease expired, resulting in OOM (-200) once cumulative writes reached total DRAM capacity.Because non-offload eviction is already prevented by
with_hard_pin = Trueand--eviction_high_watermark_ratio=1.0 --eviction_ratio=0.0(and TransferQueue never enables soft pinning), these three overrides are unnecessary and can be removed in favor of Mooncake's default lease TTL (10 s in Mooncake 0.3.14).Changes
transfer_queue/storage/clients/mooncake_client.py: Checkisinstance(offload_conf, Mapping)instead ofdictwhen resolvingoffload.enabledforhard_pinauto-management.transfer_queue/storage/bootstrap/mooncake_bootstrap.py:-default_kv_lease_ttl=999999,-default_kv_soft_pin_ttl=999999, and--allow_evict_soft_pinned_objects=falsefrom themooncake_masterlaunch command so Mooncake uses its default lease TTL.offload: nullsafely (get("offload") or {}).tests/test_mooncake_offload.py: Add unit tests coveringwith_hard_pinauto-management for both OmegaConfDictConfigand plaindict(includingoffload: nulland explicithard_pinoverrides) andmooncake_master/mooncake_clientbootstrap flags.Verification
Unit Tests & Linters
python -m compileall -q transfer_queue tutorial tests: passedpython -m pytest -q tests/test_mooncake_offload.py tests/test_mooncake_bootstrap.py tests/test_mooncake_buffer_pool.py tests/test_mooncake_client_thread_context.py tests/test_mooncake_utils.py: 96 passed, 7 skippedpre-commit(ruff,ruff format,mypy,check-license,check-docstrings): all passedTwo-Node RDMA End-to-End Verification
Tested on a 2-node RDMA cluster (
mooncake-transfer-engine-cuda13==0.3.14, Rust controller,protocol: rdma,metadata_server: P2PHANDSHAKE,global_segment_size: 512 MiB× 3 segments = 1.50 GiB total DRAM,eviction_high_watermark_ratio: 0.5,eviction_ratio: 0.3), writing 240 × 8 MiB = 1.92 GiB (> 1.50 GiB DRAM) from Node 1 and reading back on Node 2:with_hard_pinhard_pin: null)True(bug)NO_AVAILABLE_HANDLE (-200)hard_pin: falseworkaround)Falsedefault_kv_lease_ttl=999999)NO_AVAILABLE_HANDLE (-200)hard_pin: null, defaulttq.init())FalseAllocFail=0)kv_batch_getverified 56/56 keys (40 oldest SSD-evicted + 16 recent) bit-exact in 1.47 s;tq.close()cleanly terminatedmooncake_client