Skip to content

sstable: treat NumDeletionsThreshold as inclusive for tombstone-dense blocks#6013

Open
cuiweixie wants to merge 1 commit intocockroachdb:masterfrom
cuiweixie:sstable-tombstone-dense-threshold-ge
Open

sstable: treat NumDeletionsThreshold as inclusive for tombstone-dense blocks#6013
cuiweixie wants to merge 1 commit intocockroachdb:masterfrom
cuiweixie:sstable-tombstone-dense-threshold-ge

Conversation

@cuiweixie
Copy link
Copy Markdown
Contributor

Previously maybeIncrementTombstoneDenseBlocks in both writers compared numDeletions > NumDeletionsThreshold, so a block with exactly NumDeletionsThreshold point tombstones was not counted toward NumTombstoneDenseBlocks.

Use >= so behavior matches the documented definition ("at least N point tombstones") in docs/RFCS/20240701_tombstone_density_heuristic.md, sstable/properties.go, and Options.Experimental.NumDeletionsThreshold.

… blocks

Previously `maybeIncrementTombstoneDenseBlocks` in both writers compared `numDeletions > NumDeletionsThreshold`, so a block with exactly `NumDeletionsThreshold` point tombstones was not counted toward `NumTombstoneDenseBlocks`.

Use `>=` so behavior matches the documented definition ("at least `N` point tombstones") in `docs/RFCS/20240701_tombstone_density_heuristic.md`, `sstable/properties.go`, and `Options.Experimental.NumDeletionsThreshold`.
@cuiweixie cuiweixie requested a review from a team as a code owner April 30, 2026 12:39
@cuiweixie cuiweixie requested a review from sumeerbhola April 30, 2026 12:39
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sumeerbhola reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on cuiweixie).


-- commits line 6 at r1:
This > vs >= for configuration thresholds is probably present in a bunch of places. For example, DeletionSizeRatioThreshold seems to have the same inconsistency.
I'd rather change the commentary instead of the code. For example,

	// NumDeletionsThreshold defines the number of point tombstones
	// that must be exceeded in a single data block for that block to be

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.

3 participants