sstable: return error from EncodeSpan on same-boundary trailer misord…#5855
Merged
sumeerbhola merged 1 commit intocockroachdb:masterfrom Mar 23, 2026
Merged
Conversation
Member
RaduBerinde
approved these changes
Mar 23, 2026
Member
RaduBerinde
left a comment
There was a problem hiding this comment.
@RaduBerinde made 2 comments.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on sumeerbhola).
sstable/colblk_writer.go line 327 at r1 (raw file):
} for i := range w.blockPropCollectors { if err := w.blockPropCollectors[i].AddRangeKeys(span); err != nil {
This path should also set w.err, since we already adjusted props and potentially added the keys to some block prop collectors.
…ering RawColumnWriter.EncodeSpan had two error paths for span ordering violations: one for same boundaries with wrong trailer order, and one for overlapping different boundaries. The second path returned the error to the caller, but the first only stored it in w.err without returning, allowing the invalid span to be silently added to the block. Add the missing `return w.err` so the error is surfaced immediately, consistent with the other error path. Additionally, set w.err on another path in addition to returning the error. Co-Authored-By: roachdev-claude <[email protected]>
1c9abec to
025b6b9
Compare
sumeerbhola
commented
Mar 23, 2026
Collaborator
Author
sumeerbhola
left a comment
There was a problem hiding this comment.
TFTR!
@sumeerbhola made 2 comments and resolved 1 discussion.
Reviewable status: 0 of 5 files reviewed, all discussions resolved (waiting on RaduBerinde).
sstable/colblk_writer.go line 327 at r1 (raw file):
Previously, RaduBerinde wrote…
This path should also set
w.err, since we already adjustedpropsand potentially added the keys to some block prop collectors.
Done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ering
RawColumnWriter.EncodeSpan had two error paths for span ordering violations: one for same boundaries with wrong trailer order, and one for overlapping different boundaries. The second path returned the error to the caller, but the first only stored it in w.err without returning, allowing the invalid span to be silently added to the block.
Add the missing
return w.errso the error is surfaced immediately, consistent with the other error path.