[GH-ISSUE #653] [Bug]: fix disk-backed replicas in size calculation & migrate to tl::expected #213

Closed
opened 2026-10-29 21:10:58 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @xiaguan on GitHub (Jul 22, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/653

Originally assigned to: @SgtPepperr on GitHub.

Bug Report

in store_py.cpp

    // Calculate total size (memory replica assumption)
    uint64_t total_length = 0;
    auto &memory_descriptors = replica_list[0].get_memory_descriptor();
    for (auto &handle : memory_descriptors.buffer_descriptors) {
        total_length += handle.size_;
    }

we only consider the memory case, but we need consider disk case, too. which cause the test run failed.

abstract a interface to solve this. And don't throw excepetion anymore, use tl::expected instead.

Before submitting...

  • Ensure you searched for relevant issues and read the [documentation]
Originally created by @xiaguan on GitHub (Jul 22, 2025). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/653 Originally assigned to: @SgtPepperr on GitHub. ### Bug Report in `store_py.cpp` ``` // Calculate total size (memory replica assumption) uint64_t total_length = 0; auto &memory_descriptors = replica_list[0].get_memory_descriptor(); for (auto &handle : memory_descriptors.buffer_descriptors) { total_length += handle.size_; } ``` we only consider the memory case, but we need consider disk case, too. which cause the test run failed. abstract a interface to solve this. And don't throw excepetion anymore, use `tl::expected` instead. ### Before submitting... - [ ] Ensure you searched for relevant issues and read the [documentation]
bsakaguchi 2026-10-29 21:10:58 +00:00
Author
Owner

@SgtPepperr commented on GitHub (Jul 23, 2025):

I will fix this problem.

<!-- gh-comment-id:3105402966 --> @SgtPepperr commented on GitHub (Jul 23, 2025): I will fix this problem.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#213
No description provided.