[PR #170] [MERGED] fix(overlaybd): preserve premerged-index cache during full-file cache recovery #225

Closed
opened 2026-10-29 14:21:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/170
Author: @huajq
Created: 8/14/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @yingdi-shan

Base: main ← Head: fix/overlaybd-cache-preserve-premerged-index


📝 Commits (1)

  • b4a4bda fix(overlaybd): preserve premerged-index cache during full-file cache recovery

📊 Changes

4 files changed (+27 additions, -2 deletions)

View changed files

📝 storage/overlaybd/src/backend/cache/full_file_cache/cache_pool.rs (+6 -0)
📝 storage/overlaybd/src/backend/cache/tests.rs (+19 -0)
📝 storage/overlaybd/src/lsmt/file/mod.rs (+1 -1)
📝 storage/overlaybd/src/lsmt/file/types.rs (+1 -1)

📄 Description

What

Skip the reserved premerged-index subdirectory when full-file cache recovery
scans cacheDir, plus a regression test.

Why

The LSMT premerged-index artifact cache lives inside the scanned cacheDir.
Every ImageService creation (node restart, uvm-ublk-daemon lazy creation /
respawn) logged load cache from disk failed err=cache meta not exists and
deleted the whole directory, wiping the cache and racing in-flight writes
(rename ... No such file or directory).

N/A — small fix from production logs.

Scope and non-goals

Included: recovery skip + test. Excluded: any on-disk layout change;
writer-side retry (no longer needed).

Design and behavior changes

Recovery skips PREMERGED_INDEX_DIR (re-exported crate-wide as the single
source of truth). Real cache entries are still discarded on load failure.

Compatibility and operations

No API, config, layout, or host requirement changes. Existing .pmidx
artifacts now persist across restarts. Safe to roll back.

Validation

cargo fmt --all -- --check                             # pass
cargo clippy -p overlaybd --all-targets -- -D warnings # pass
cargo test -p overlaybd --lib                          # 310 passed, 0 failed

Skipped: make wrappers and unrelated suites; only overlaybd is touched.

Risks and reviewer notes

Main file: storage/overlaybd/src/backend/cache/full_file_cache/cache_pool.rs.
Only effect is that the directory named premerged-index survives recovery.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/170 **Author:** [@huajq](https://github.com/huajq) **Created:** 8/14/2026 **Status:** ✅ Merged **Merged:** 8/15/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `fix/overlaybd-cache-preserve-premerged-index` --- ### 📝 Commits (1) - [`b4a4bda`](https://github.com/kvcache-ai/AgentENV/commit/b4a4bda25c3ba98955f0346ff7c3808e6b5dd26a) fix(overlaybd): preserve premerged-index cache during full-file cache recovery ### 📊 Changes **4 files changed** (+27 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `storage/overlaybd/src/backend/cache/full_file_cache/cache_pool.rs` (+6 -0) 📝 `storage/overlaybd/src/backend/cache/tests.rs` (+19 -0) 📝 `storage/overlaybd/src/lsmt/file/mod.rs` (+1 -1) 📝 `storage/overlaybd/src/lsmt/file/types.rs` (+1 -1) </details> ### 📄 Description ## What Skip the reserved `premerged-index` subdirectory when full-file cache recovery scans `cacheDir`, plus a regression test. ## Why The LSMT premerged-index artifact cache lives inside the scanned `cacheDir`. Every `ImageService` creation (node restart, uvm-ublk-daemon lazy creation / respawn) logged `load cache from disk failed err=cache meta not exists` and deleted the whole directory, wiping the cache and racing in-flight writes (`rename ... No such file or directory`). ## Related issue N/A — small fix from production logs. ## Scope and non-goals Included: recovery skip + test. Excluded: any on-disk layout change; writer-side retry (no longer needed). ## Design and behavior changes Recovery skips `PREMERGED_INDEX_DIR` (re-exported crate-wide as the single source of truth). Real cache entries are still discarded on load failure. ## Compatibility and operations No API, config, layout, or host requirement changes. Existing `.pmidx` artifacts now persist across restarts. Safe to roll back. ## Validation ```text cargo fmt --all -- --check # pass cargo clippy -p overlaybd --all-targets -- -D warnings # pass cargo test -p overlaybd --lib # 310 passed, 0 failed ``` Skipped: `make` wrappers and unrelated suites; only `overlaybd` is touched. ## Risks and reviewer notes Main file: `storage/overlaybd/src/backend/cache/full_file_cache/cache_pool.rs`. Only effect is that the directory named `premerged-index` survives recovery. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:21:12 +00:00
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/AgentENV#225
No description provided.