kvcache-ai / kvcache-ai/Mooncake
[Bug]: File-per-key storage fails to initialize when eviction is disabled
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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