Skip to content

feat(xtest): sparse sink that keeps only planned TDF extents - #654

Open
sujankota wants to merge 1 commit into
DSPX-5111-range-serverfrom
DSPX-5111-sparse-sink
Open

sujankota wants to merge 1 commit into
DSPX-5111-range-serverfrom
DSPX-5111-sparse-sink

Conversation

@sujankota

Copy link
Copy Markdown
Contributor

DSPX-5111 part 2 of 2. Stacked on #653.

  • SparseSink receives a TDF as a series of in-order write() calls and copies only the retention-plan extents into an ExtentStore. It also holds the last tail_ceiling bytes in a rolling buffer.
    • On close() it parses the central directory out of that buffer, keeps everything after the payload data (manifest entry, directory and end records), and records the logical length.
    • If the tail is longer than the ceiling, it raises ManifestTooLarge instead of keeping part of it. At 50 TiB with 2 MiB segments the manifest is about 2.6 GB, so the ceiling has to be sized for the run.
  • zipinspect.read_central_directory() parses from any seekable source of a known size, so the buffer can stand in for the whole file. central_directory(path) now delegates to it, and the existing ZIP64 tests pass unchanged.
  • The sink is a plain write() consumer, so DSPX-5108's counted output sink can wrap it later. Wiring a real SDK's output into it is left to 5108 and 5118.

Tests feed a synthetic TDF through the sink in chunks of 1 B, 7 B, 4 KiB and 1 MiB, with ZIP32 and ZIP64 local headers. They also cover a tail over the ceiling and a stream that ends before a planned extent.

DSPX-5111 part 2. SparseSink takes a TDF as a stream of writes, copies
only the retention-plan extents into an ExtentStore, and holds the last
tail_ceiling bytes in a rolling buffer. On close it parses the central
directory out of that buffer, keeps everything after the payload data
(manifest entry, directory, end records), and records the logical
length. A tail longer than the ceiling raises ManifestTooLarge instead
of keeping part of it.

zipinspect gains read_central_directory, which parses from any seekable
source of a given size, so the buffer can stand in for the whole file.

Signed-off-by: sujan kota <sujankota@gmail.com>
@sujankota
sujankota requested review from a team as code owners October 17, 2026 21:03
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

Review skipped

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

🗂️ Base branches to auto review: 1
  • main

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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a1b2ae0c-8a4b-4de8-bbad-224e9910fa4a

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

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

@sonarqubecloud

Copy link
Copy Markdown

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