Skip to content

Add durable echo-cas disk tier#619

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/570-durable-retained-blob-tier
Jun 28, 2026
Merged

Add durable echo-cas disk tier#619
flyingrobots merged 1 commit into
mainfrom
cycle/570-durable-retained-blob-tier

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Add a fallible filesystem-backed DiskTier for durable retained blobs in echo-cas.
  • Preserve content-only BLAKE3 hash semantics while keeping filesystem I/O honest through DiskTierError instead of forcing the current infallible BlobStore trait.
  • Add focused disk_tier tests for process reconstruction, verified-write mismatch non-mutation, missing-as-absence, sorted listing, and stale temp-file tolerance.
  • Update echo-cas docs and changelog signposts for the new durable tier.

Closes #570.

Validation

  • cargo test -p echo-cas disk_tier
  • cargo clippy -p echo-cas --all-targets -- -D warnings
  • cargo test -p echo-cas
  • RUSTDOCFLAGS='-D warnings' cargo doc -p echo-cas --no-deps
  • npx markdownlint-cli2 CHANGELOG.md crates/echo-cas/README.md
  • git diff --check
  • commit hook: cargo clippy -p echo-cas --lib --tests
  • commit hook: cargo check -p echo-cas
  • pre-push hook: cargo test -p echo-cas --test disk_tier

API note

DiskTier intentionally exposes fallible methods directly instead of implementing BlobStore: the current trait cannot return filesystem errors from put or get, and this tier should not hide I/O failures behind content-addressed absence.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@flyingrobots, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43fc9a5e-de45-494c-82fa-b0b2b0b4e5ce

📥 Commits

Reviewing files that changed from the base of the PR and between d2c1c9c and 787dd8e.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • crates/echo-cas/README.md
  • crates/echo-cas/src/disk.rs
  • crates/echo-cas/src/lib.rs
  • crates/echo-cas/src/memory.rs
  • crates/echo-cas/tests/disk_tier.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/570-durable-retained-blob-tier

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Code Lawyer update

Issue Resolution Resolving commit
No unresolved review threads GraphQL review-thread scan returned zero threads; CI checks are passing with path-based skips only; CodeRabbit reported rate-limit/out-of-credits only. 787dd8e

Validation highlights:

  • cargo test -p echo-cas disk_tier
  • cargo clippy -p echo-cas --all-targets -- -D warnings
  • cargo test -p echo-cas
  • RUSTDOCFLAGS='-D warnings' cargo doc -p echo-cas --no-deps

@flyingrobots
flyingrobots merged commit a7d4b1c into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/570-durable-retained-blob-tier branch June 28, 2026 03:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 787dd8eee3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +86 to +89
fs::rename(&temp_path, &path).map_err(|source| {
let _ = fs::remove_file(&temp_path);
DiskTierError::io("rename", &path, source)
})?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve idempotent puts when the blob file exists

On Windows, std::fs::rename fails if the destination file already exists, so a second put/put_verified for bytes that are already retained returns DiskTierError::Io instead of remaining CAS-idempotent. This affects retry/reopen paths and concurrent same-blob writes; short-circuit an existing verified blob or use platform-safe replacement handling before renaming.

Useful? React with 👍 / 👎.

Comment on lines +84 to +86
fs::write(&temp_path, bytes)
.map_err(|source| DiskTierError::io("write", &temp_path, source))?;
fs::rename(&temp_path, &path).map_err(|source| {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Sync writes before acknowledging durability

When callers rely on DiskTier as a durable retained-blob tier, returning Ok after fs::write and rename without syncing means a power loss or OS crash can lose the blob or leave an incomplete file even though the write was acknowledged. The write path should sync the temp file before the rename and sync the containing directory after it so crash recovery matches the successful return.

Useful? React with 👍 / 👎.

Comment on lines +37 to +39
let root = root.as_ref().to_path_buf();
let blobs_dir = root.join("blobs");
fs::create_dir_all(&blobs_dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Anchor relative roots when opening the tier

When callers open a relative root such as DiskTier::open("cas") and a CLI/test later changes the process current directory, the stored root/blobs_dir paths start resolving against the new cwd, so get/list can report retained blobs as missing or put can create a second store elsewhere. Since open already creates the directory, canonicalize the root at open time so the handle stays bound to the directory it opened.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GP4-S2] Durable Retained Blob Tier

1 participant