Skip to content

fix(corded-buffer): advance across empty corded slices - #53

Merged
lorenzhs merged 1 commit into
release-24.0.0from
lorenz/fb-4526-corded-empty-slices
Oct 5, 2026
Merged

lorenzhs merged 1 commit into
release-24.0.0from
lorenz/fb-4526-corded-empty-slices

Conversation

@lorenzhs

@lorenzhs lorenzhs commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Parquet page-reader tests with an empty slice between header chunks asserted in CordedBuffer::Advance() because its offset assertion rejects a zero-length slice.

Summary

Allow an offset equal to the slice size and continue traversing at exact boundaries, so advancing skips consecutive empty slices and reaches the next nonempty slice or the end of the buffer.

Test Plan

  • Verified in PackDB under ASan with the Parquet page-decompression tests and a focused regression covering leading, consecutive, and trailing empty slices, zero-byte advances, exact boundaries, and advances past the end.

Note

Low Risk
Narrow change to corded-buffer cursor advancement with no auth, I/O, or data-format surface area beyond fixing boundary handling for empty slices.

Overview
Fixes CordedBuffer::Advance() so it no longer aborts when the cursor sits on zero-length slices (e.g. empty gaps between Parquet header chunks in page-reader tests).

The debug assert now allows slice_offset_ equal to slice.size(), and the special case that returned immediately when skipping exactly to a slice boundary was removed. Advancing to the end of a slice now accumulates skipped bytes and keeps iterating, so leading, consecutive, and trailing empty slices are skipped until the next nonempty data or the buffer end.

Reviewed by Cursor Bugbot for commit 2d87397. Bugbot is set up for automated code reviews on this repo. Configure here.

@lorenzhs
lorenzhs requested a review from a team October 5, 2026 17:15
@lorenzhs
lorenzhs marked this pull request as ready for review October 5, 2026 17:15
@lorenzhs lorenzhs changed the title fix(buffer): advance across empty corded slices (FB-4526) fix(corded-buffer): advance across empty corded slices Oct 5, 2026
@lorenzhs
lorenzhs merged commit 45250cb into release-24.0.0 Oct 5, 2026
10 checks passed
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