kvcache-ai / kvcache-ai/Mooncake

[Bug]: File-per-key storage fails to initialize when eviction is disabled

Open
#2,981 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
6.6k
Forks
1.2k
Avg merge
3d 5h
Merged PRs (30d)
312

Description

## Bug Report

On current `main` , the file-per-key backend cannot complete `FileStorage::Init()` when `MOONCAKE_OFFLOAD_ENABLE_EVICTION=false`.

The call order is:

1. `storage_backend_->Init()`
2. `FileStorage::IsEnableOffloading()`
3. `storage_backend_->ScanMeta()`

For `StorageBackendAdaptor`, `IsEnableOffloading()` returns `INTERNAL_ERROR` while `meta_scanned_` is false when eviction is disabled. The first metadata scan is later in `FileStorage::Init()`, so initialization returns before it can ever establish the counters required by `IsEnableOffloading()`.

The adaptor unit test already documents that `ScanMeta()` must run before `IsEnableOffloading()` in this configuration, but the production initialization path does the reverse.

## Expected behavior

File-per-key storage should initialize successfully with eviction disabled, reconstruct existing usage before enabling new offloads, and register recovered LOCAL_DISK metadata with the master.

### Before submitting...

- [x] Searched existing issues and open PRs for this initialization failure.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at FileStorage::Init() and compare its call order with the StorageBackendAdaptor unit test, which documents that ScanMeta() must precede IsEnableOffloading() when eviction is disabled. Verify initialization with MOONCAKE_OFFLOAD_ENABLE_EVICTION=false, including usage reconstruction and registration of recovered LOCAL_DISK metadata with the master.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.