[PD] Preserve abort ACKs until in-flight KV transfers drain (#40645)

This commit is contained in:
cctry
2026-09-22 18:46:07 +08:00
committed by GitHub
parent 9d58189c12
commit 8ef6d31cb9
3 changed files with 31 additions and 6 deletions
@@ -1657,9 +1657,12 @@ class CommonKVSender(BaseKVSender):
if hasattr(self.kv_mgr, "transfer_infos"):
self.kv_mgr.transfer_infos.pop(self.bootstrap_room, None)
if hasattr(self.kv_mgr, "_deferred_ack_targets"):
# Drop a held ack target if the room concluded without draining
# (e.g. aborted before any chunk enqueued); else it leaks on prefill.
self.kv_mgr._deferred_ack_targets.pop(self.bootstrap_room, None)
if hasattr(self.kv_mgr, "_staging_outstanding"):
# Preserve the target until in-flight writes drain, even when
# the scheduler has already observed Failed and cleared the room.
self.kv_mgr._maybe_ack_drained_abort(self.bootstrap_room)
else:
self.kv_mgr._deferred_ack_targets.pop(self.bootstrap_room, None)
def abort(self):
self.kv_mgr.record_failure(
@@ -2469,9 +2469,11 @@ class MooncakeKVManager(StagingManagerMixin, CommonKVManager):
# first would let the worker drain+ack while the room is
# not yet Failed, so a newly enqueued chunk could still
# write to the freed pages. The worker (not this thread)
# acks once its in-flight write drains; if nothing is in
# flight, decode falls back to the release timeout.
if room_active:
# acks once its in-flight write drains.
if (
room_active
or self._staging_outstanding.get(room_to_be_aborted, 0) > 0
):
self.update_status(room_to_be_aborted, KVPoll.Failed)
self.register_deferred_ack_target(
room_to_be_aborted, decode_ip, decode_port