Skip to content

fix(ingester): rfc 0047 erasure rewrites count as compactions - #709

Merged
jensholdgaard merged 2 commits into
mainfrom
rfc-0047-followup-erasure-accounting
Aug 18, 2026
Merged

fix(ingester): rfc 0047 erasure rewrites count as compactions#709
jensholdgaard merged 2 commits into
mainfrom
rfc-0047-followup-erasure-accounting

Conversation

@jensholdgaard

Copy link
Copy Markdown
Owner

Summary

Follow-up to #708 (Copilot's two suppressed notes):

  • An RFC 0047 §3.6 erasure rewrite now counts as a compaction in the sweep's accounting and audit trail — partitions_compacted / files_compacted / rows_compacted / bytes_read / compacted_files (bytes written) / gc_failures, plus a compaction audit event per committed rewrite — so ourios.compaction.* no longer under-reports erasure IO and the audit stream shows which files were rewritten. The conversation_erased event still comes last (unit test asserts both).
  • The OpenFGA read_by_object error text names the failing step ("read response body") instead of the copy/paste "read read".

Related

RFC 0047 (#705#708).

Checklist

  • cargo fmt clean
  • cargo clippy clean (no new warnings)
  • Tests added/updated
  • RFC linked

🤖 Generated with Claude Code

https://claude.ai/code/session_01JZXtbyWoQY19ZGtNecDfgv

…rror text

Copilot follow-ups on #708: an erasure rewrite now feeds the sweep's IO
accounting and audit trail like any compaction (partitions/files/rows/
bytes, a compaction event per committed rewrite, gc failures), so
ourios.compaction.* stops under-reporting; the OpenFGA read error text
names the step.

Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
@jensholdgaard
jensholdgaard requested a lite review from Copilot August 18, 2026 02:23
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jensholdgaard, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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 reviews.

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c0c4bc4-6e4d-4245-b908-b44ca47f1bf0

📥 Commits

Reviewing files that changed from the base of the PR and between 1139009 and 228b4fb.

📒 Files selected for processing (2)
  • crates/ourios-core/src/auth/openfga/client.rs
  • crates/ourios-ingester/src/compactor.rs

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR is a follow-up to the RFC 0047 erasure work, ensuring that erasure-driven partition rewrites are treated as first-class compactions in the ingester sweep’s accounting (metrics + audit trail), and tightening an OpenFGA client error message for clearer diagnostics.

Changes:

  • Count committed erasure rewrites as compactions in SweepReport (partitions/files/rows/bytes + compacted file samples + GC failures) and emit a Compaction audit event per committed rewrite.
  • Extend the erasure unit test to assert the rewrite produces a compaction audit event and is reflected in sweep IO accounting.
  • Improve OpenFGA read_by_object error text (“read response body”) to identify the failing step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/ourios-ingester/src/compactor.rs Treat erasure rewrites as compactions for sweep accounting/auditing; strengthen test assertions around audit + IO stats.
crates/ourios-core/src/auth/openfga/client.rs Fix OpenFGA error message wording for failed Read response body reads.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/ourios-ingester/src/compactor.rs
Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

crates/ourios-ingester/src/compactor.rs:550

  • In the erasure rewrite path, report.gc_failures is only incremented when a rewrite is committed (o.committed.is_some()). In the main compaction pass, gc_failures is incremented for every compact_partition_hooked outcome (even when no commit happens), so the sweep’s GC-failure accounting can be under-reported for erasure partitions. Consider mirroring the main pass by moving the report.gc_failures += o.gc_failures line outside the if let Some(committed) block.
                        if let Some(committed) = &o.committed {
                            outcome.partitions_rewritten += 1;
                            outcome.rows_dropped += o.rows_dropped;
                            // An erasure rewrite is a compaction like any
                            // other for the sweep's IO accounting and audit

@jensholdgaard
jensholdgaard merged commit 5cc0777 into main Aug 18, 2026
30 checks passed
@jensholdgaard
jensholdgaard deleted the rfc-0047-followup-erasure-accounting branch August 18, 2026 02:37
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.

2 participants