[PR #85] [MERGED] feat(overlaybd): introduce index() and flatten_with_args() from LSMTFile #168

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

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/85
Author: @huang-jl
Created: 7/30/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @yingdi-shan

Base: main ← Head: hjl/expose-index-from-LSMTFile


📝 Commits (1)

  • 5c112bf feat(overlaybd): introduce index() and flatten_with_args() from LSMTFile

📊 Changes

1 file changed (+9 additions, -2 deletions)

View changed files

📝 storage/overlaybd/src/lsmt/file/readwrite.rs (+9 -2)

📄 Description

What

Expose two new capabilities from the read-write LSMTFile:

  • Add index() to return the shared Arc<RwLock>.
  • Add flatten_with_args() to support custom CommitArgs.

The existing flatten() method remains backward-compatible and delegates to flatten_with_args() with default arguments.

Why

Higher-level callers need access to the combined LSMT index and finer control over flatten operations, including the destination writer, UUID metadata, user tags, and write concurrency.

Previously, these capabilities were only available internally.

Design and behavior changes

index() clones and returns the internal Arc<RwLock>. Callers share the same index instance with LSMTFile and must use the existing lock for synchronization.

flatten_with_args():

  1. Loads the current virtual size.
  2. Acquires an index read lock and resolves mappings for the full logical address range.
  3. Releases the index lock.
  4. Passes the mappings, source layers, virtual size, and caller-provided CommitArgs to compact_to().

The existing method now delegates as follows: flatten_with_args(CommitArgs::new(dest_file)).

Existing callers therefore retain the same default metadata and sequential write behavior. Read and write failures continue to propagate from compact_to().

Compatibility and operations

  • Public API or generated protocol: Adds public Rust APIs to the OverlayBD crate. No HTTP or generated protocol changes.
  • Configuration or defaults: No changes.
  • Snapshot manifest, artifact layout, or storage format: No default behavior or format changes.
  • Upgrade and rollback: No migration is required. Code using the new methods will no longer compile after rollback.
  • Host requirements, permissions, ports, or dependencies: No changes.

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/85 **Author:** [@huang-jl](https://github.com/huang-jl) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 7/31/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `hjl/expose-index-from-LSMTFile` --- ### 📝 Commits (1) - [`5c112bf`](https://github.com/kvcache-ai/AgentENV/commit/5c112bfd02a3131082f31353c06a9bb12a63756a) feat(overlaybd): introduce index() and flatten_with_args() from LSMTFile ### 📊 Changes **1 file changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `storage/overlaybd/src/lsmt/file/readwrite.rs` (+9 -2) </details> ### 📄 Description ## What Expose two new capabilities from the read-write LSMTFile: - Add index() to return the shared Arc<RwLock<ComboIndex>>. - Add flatten_with_args() to support custom CommitArgs. The existing flatten() method remains backward-compatible and delegates to flatten_with_args() with default arguments. ## Why Higher-level callers need access to the combined LSMT index and finer control over flatten operations, including the destination writer, UUID metadata, user tags, and write concurrency. Previously, these capabilities were only available internally. ## Design and behavior changes index() clones and returns the internal Arc<RwLock<ComboIndex>>. Callers share the same index instance with LSMTFile and must use the existing lock for synchronization. flatten_with_args(): 1. Loads the current virtual size. 2. Acquires an index read lock and resolves mappings for the full logical address range. 3. Releases the index lock. 4. Passes the mappings, source layers, virtual size, and caller-provided CommitArgs to compact_to(). The existing method now delegates as follows: `flatten_with_args(CommitArgs::new(dest_file))`. Existing callers therefore retain the same default metadata and sequential write behavior. Read and write failures continue to propagate from compact_to(). ## Compatibility and operations <!-- Explain applicable compatibility and deployment impact. Write "N/A" with a reason where appropriate. --> - Public API or generated protocol: Adds public Rust APIs to the OverlayBD crate. No HTTP or generated protocol changes. - Configuration or defaults: No changes. - Snapshot manifest, artifact layout, or storage format: No default behavior or format changes. - Upgrade and rollback: No migration is required. Code using the new methods will no longer compile after rollback. - Host requirements, permissions, ports, or dependencies: No changes. ## 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:20:36 +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#168
No description provided.