mirror of
https://github.com/lightseekorg/tokenspeed.git
synced 2026-12-04 10:26:50 +08:00
Cache clears and weight updates could remain blocked after L3 I/O failed to prove retirement. This change separates cache invalidation from physical buffer ownership, allowing the engine to continue using remaining capacity. - Drain healthy storage work asynchronously before recovery. Configure the budget with `async.clear_cache_drain_timeout_ms` (default: 500 ms; 0 skips waiting). - Cancel queued PUTs and detach running operations. Retain their Host references until all owners confirm retirement; late completions cannot republish old cache data. - Isolate subsequent L3 work in a fresh generation when current I/O is unsafe or the drain budget expires. Preserve mirrored TP/KVP allocation and support unequal remaining capacity across DP replicas. - Treat `ILLEGAL_CLIENT` as a failed, source-retired PUT under the audited default Host ABI. Transfer/RPC/unknown errors remain conservative. Use existing Mooncake APIs without an additional post-PUT confirmation RPC. - Keep namespace collectives consistent even when some DP members retain their current weight version. Preserve ordinary flush preflight semantics and reserve exact ownership checks for retaining recovery. - Exclude isolated tickets from idle and NoProgress checks. Separate historical `l3_io_quarantined` from current `l3_io_blocked`, with retained-capacity metrics and updated operational guidance. - Reject new best-effort PUTs when all write workers remain occupied by old-generation I/O, preventing queued writes from closing otherwise healthy query/read admission. - Prepare Controls, L3 namespace plans and isolation nonces before publishing metadata. Commit only after every rank is ready; preparation failures preserve the previous namespace identities and allow safe retries. Recovery skips remote purge and can reduce cross-engine sharing for the current weight version. Retained buffers still consume capacity and I/O credits; a clear does not prove native cancellation or permit deregistration. Validation: - 96 serving and 334 C++ storage/peer/cache tests passed. - 216 control, 65 L3, 5 SDK, 27 scheduler FFI, 7 Prometheus, and 9 Peer tests passed. - Configuration parsing and Python-to-Rust budget propagation verified. - Production host `cargo check` and `pre-commit run --all-files` passed. --------- Signed-off-by: MaskVulcan <9528071+MaskVulcan@users.noreply.github.com> Signed-off-by: FC-Li <robert_lexis@163.com> Co-authored-by: MaskVulcan <9528071+MaskVulcan@users.noreply.github.com> Co-authored-by: FC-Li <robert_lexis@163.com> Co-authored-by: longcat-ia-team <longcat_ia_team@meituan.com>