Skip to content

feat(oplog): read past damage in the op log - #109

Open
PiquelChips wants to merge 1 commit into
feat/events-index-catch-upfrom
feat/events-oplog-damage
Open

PiquelChips wants to merge 1 commit into
feat/events-index-catch-upfrom
feat/events-oplog-damage

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Damage in the middle of an op log segment hid every entry after it: readers stopped there, and so did appends.

Readers now read past damage from both ends of the segment. They report how many entries it hid, on stderr and in Read::damage. The index rebuilds itself from the store when the op log lost entries, since those entries may have named records. The first reader to find damage in the last segment starts a new segment, so appends continue past it.

Damage at the end of the last segment hides how many entries it held. The next append skips as many sequence numbers as those bytes could hold, so none is reused. A damaged length is never mistaken for a half-written last entry. A segment shorter than its header is damage, not a panic, and appends continue past it.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0e598c13-7874-4b67-b7ff-37011a66b4d6
Commits

Reviewing files that changed from the base of the PR and between 81d71fa and 272099d.

Files selected for processing: 3

  • apps/origin-src/src/frames.rs
  • apps/origin-src/src/index.rs
  • apps/origin-src/src/oplog.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@PiquelChips
PiquelChips added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/events-oplog-damage branch 2 times, most recently from f49143f to 06fe113 Compare November 22, 2026 18:54
Damage in the middle of a segment hid every entry after it: readers
stopped there, and so did appends.

Readers now read past it, from both ends of the segment, and report how
many entries it hid, on stderr and in `Read::damage`. The index rebuilds
itself from the store when the op log lost entries, since those may have
named records. The first reader to find damage in the last segment starts
a new one, so appends continue past it.

Damage at the end of the last segment hides how many entries it held:
the next append skips as many sequence numbers as it could hold, so none
is reused. A damaged length is never mistaken for a half-written last
entry, and a segment shorter than its header is damage, not a panic.
@PiquelChips
PiquelChips force-pushed the feat/events-oplog-damage branch from 06fe113 to 272099d Compare November 22, 2026 19:20
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.

1 participant