Repository navigation
[Store] Give LOCAL_DISK segments an unmount half, and let the offload RPC honour connect timeouts - #1
Conversation
… RPC honour connect timeouts LOCAL_DISK segments can only leave the master by client expiry: every other segment kind has a client-callable unmount RPC, but UnmountLocalDiskSegment exists only as an internal function called from the ClientMonitorFunc expiry branch. A store shutting down therefore keeps advertising itself as the owner of the keys it offloaded for up to client_ttl, and reads that land in that window reach a peer that can no longer serve them. Exposes MasterService::UnmountLocalDiskSegment(client_id) through the layers the mount half already crosses (rpc_service -> master_client -> client_service), adds FileStorage::DrainLocalDiskSegment(grace_period_ms), and surfaces it as the Python binding unmount_local_disk_segment() and REST POST /api/unmount_local_disk so a preStop hook can call it. Also lets the offload RPC honour MC_RPC_CONNECT_TIMEOUT_MS. Measured on a two-node rig: on a planned scale-in through the new preStop drain, 8 concurrent readers saw zero blocked reads and a 40 ms worst case, with the master dropping the disk replicas 1.7 s after the request rather than at TTL expiry 30 s later. The same crash without the timeout override parked one read per worker for 33-62 s; with MC_RPC_CONNECT_TIMEOUT_MS=1000 the worst case is 4.2 s. 654,123 reads byte-checked across all arms, zero wrong answers. Upstream PR: kvcache-ai#3316 Linear: INF-291
라이브 대조 검증 (2026-08-10) — merge 보류, open 유지ganymede 두 프로덕션 셀의 mooncake tier를 확인한 결과 이 패치는 라이브에 들어가 있지 않다. 따라서 "라이브 반영분"으로 merge하지 않고, upstream 추적 및 향후 채택 대상으로 open(ready for review) 상태로 둔다. 라이브 mooncake는 stock이다
둘 다 stock 이미지 안의 mooncake wheel을 그대로 쓰고, 패치된 wheel/ 파드 안에서 직접 확인한 부재 증거
오늘(2026-08-10) 배포는 mooncake가 아니었다오늘 재기동된 것은 그래서 왜 close하지 않는가
⇒ 채택(=merge)은 이 빌드를 실제로 배포하는 시점에 한다. 그때까지 open. 참고: 측정 근거는 rig 기준이 PR 본문의 실측(blocked read 0·40ms·master 1.7s·654,123 reads 바이트 대조)은 2노드 rig에서 얻은 것이고 프로덕션 실측이 아니다. INF-291 기록 참조. |
결정 정정 — merge 한다 (직전 코멘트의 "merge 보류" 철회)직전 코멘트는 "라이브에 없으므로 merge 보류"로 결론지었으나, 그 판단은 브랜치 모델을 잘못 적용한 것이다. 정정한다.
이 패치는 리뷰를 통과했고 채택 대상이므로 배포 태그는 지금 따지 않는다 — 라이브가 우리 fork 산출물이 아니기 때문"현재 라이브 상태를
세 가지 이유로 태그를 보류한다:
⇒ 진짜 배포 태그는 우리가 mooncake를 실제로 빌드해 배포하는 시점에 유지되는 사실 (직전 코멘트에서 그대로 유효)
|
무엇
LOCAL_DISK세그먼트에 unmount 반쪽을 주고, offload RPC가 connect 타임아웃을 지키게 한다.LOCAL_DISK세그먼트는 클라이언트 만료로만 master를 떠난다. 다른 세그먼트 종류는 클라이언트가 부를 수 있는 unmount RPC가 다 있는데(UnmountSegment·GracefulUnmountSegment·UnmountNoFSegment)UnmountLocalDiskSegment만ClientMonitorFunc만료 분기에서 불리는 내부 함수로 존재한다. mount 반쪽은 전 계층에 깔려 있으니 설계 제약이 아니라 빠뜨린 절반이다.결과: 종료 중인 store가 ping을 멈춘 뒤 최대
client_ttl동안 자기가 offload한 키의 소유자로 계속 광고된다. 그 창에 들어온 읽기는 더는 서빙할 수 없는 peer에 닿는다.어떻게
MasterService::UnmountLocalDiskSegment(client_id)를 mount 반쪽이 이미 지나간 계층(rpc_service→master_client→client_service)에 노출FileStorage::DrainLocalDiskSegment(grace_period_ms)추가unmount_local_disk_segment(grace_period_seconds)+ RESTPOST /api/unmount_local_disk→ preStop에서 호출 가능MC_RPC_CONNECT_TIMEOUT_MS를 지키도록 수정실측 (2노드 rig, INF-291)
MC_RPC_CONNECT_TIMEOUT_MS=1000적용 후관리 정보
v0.3.12.post1(이 패치는 어떤 릴리스에도 없음 —v0.3.11.post1·v0.3.12.post1모두 미포함)sglang-patch/patches/mooncake-inf291-unmount/autoresearch/2026-08-06-inf291-localdisk-unmount/