Skip to content

fix(store): bound what reading each object reads ahead - #171

Open
PiquelChips wants to merge 1 commit into
fix/read-only-the-log-entries-afrom
fix/bound-what-reading-each-object-reads
Open

PiquelChips wants to merge 1 commit into
fix/read-only-the-log-entries-afrom
fix/bound-what-reading-each-object-reads

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

read_each read a whole chunk, up to 4096 objects, before handing any of them to its callback, and sized each chunk from the previous one. So thousands of small objects followed by large blobs could load gigabytes before a snapshot part noticed it was full. On top of that, one object it couldn't read failed the whole chunk, even when the part filled before reaching that object, so the valid part and its continuation were lost.

The threads reading a chunk now share a byte count and stop once it reaches the chunk's target (8 MiB), each still reading at least one object so the reads keep making progress. The chunk hands over objects in order, up to the first thread that stopped early, and the rest come with the next chunk. Each object's read error is kept until the callback reaches it.

clone_snapshot and fetch_100_edited (just bench, sample count 10, on a loaded machine, so only the fastest runs mean much): clone 3.003 s before, 2.572 s after; fetch of 100 edited files 238.4 ms before, 103.4 ms after.

Part of #166.

Note

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

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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: 465308c8-41a9-42e1-aa61-418f5b3ed5ca

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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 #185 November 22, 2026 20:21
@PiquelChips
PiquelChips removed this pull request from stack #185 November 22, 2026 20:22
`read_each` read a whole chunk, up to 4096 objects, before handing any to
its callback, sized from the previous chunk: thousands of small objects
followed by large blobs could load gigabytes before a snapshot part saw it
was full. And one object it couldn't read failed the whole chunk, even
when the part filled before reaching it, losing the valid part.

The cores reading a chunk now share a byte count and stop once it reaches
the target, the chunk handing over objects up to the first part cut short,
and each object's read error is kept until the callback reaches it.
@PiquelChips
PiquelChips force-pushed the fix/bound-what-reading-each-object-reads branch from 50c363b to 81576a0 Compare November 22, 2026 20:22
@PiquelChips
PiquelChips force-pushed the fix/read-only-the-log-entries-a branch from d3154c5 to 29b19cc Compare November 22, 2026 20:22
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