Skip to content

CASSANDRA-21617: STCS min_sstable_size should accept data storage units - #5070

Open
aviau wants to merge 1 commit into
apache:cassandra-5.0from
aviau:aviau/stcs-min-size
Open

CASSANDRA-21617: STCS min_sstable_size should accept data storage units#5070
aviau wants to merge 1 commit into
apache:cassandra-5.0from
aviau:aviau/stcs-min-size

Conversation

@aviau

@aviau aviau commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The documentation for STCS says min_sstable_size defaults to 50MB.

I think this is wrong in two ways:

  • 50MB is not an accepted value, it only accepts numbers without units.
  • The real default is actually equivalent to 50MiB.

This commit changes it to be more consistent with UCS and accept storage units.

Assisted-by: Claude Code:claude-opus-5

Patch by Alexandre Viau; reviewed by TODO for CASSANDRA-21617

@aviau
aviau changed the base branch from trunk to cassandra-5.0 August 27, 2026 00:39
@aviau
aviau force-pushed the aviau/stcs-min-size branch 3 times, most recently from fd50d5b to 481792e Compare August 27, 2026 02:43
@smiklosovic

smiklosovic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

what if I have a cluster with mixed versions and I create a table with this parameter to be "50MiB", then it comes to a node which will not know how to parse it

however, it is not a good idea to change schema in a mixed-versions scenario, just thinking about the consequences of doing so

@smiklosovic

Copy link
Copy Markdown
Contributor

what I think should happen is that we need to be sure that what we serialize is raw number instead of "50MiB" string. Accepting such a value and serializing it are two different things.

@aviau
aviau force-pushed the aviau/stcs-min-size branch from 481792e to 9f02bd4 Compare August 27, 2026 21:03
@aviau

aviau commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Hey @smiklosovic,

mixed-versions scenario

Duh. That's a fair point. Or even rollbacks could be bad I guess.

New contributor here so thanks for taking the time -- I'll think about mixed versions next time.

I updated the MR, do you want to take another look?

@aviau
aviau force-pushed the aviau/stcs-min-size branch 3 times, most recently from 0a3f001 to 6a31cec Compare August 27, 2026 21:15
The documentation for STCS says `min_sstable_size` defaults to `50MB`.

I think this is wrong in two ways:
- `50MB` is not an accepted value, it only accepts numbers without units.
- The real default is actually equivalent to `50MiB`.

This commit changes it to be more consistent with UCS and accept storage
units. LCS and TWCS also read `min_sstable_size` through
SizeTieredCompactionStrategyOptions, so they accept units too.

Values are normalized to a plain byte count before the schema is stored,
so what we serialize and propagate stays parsable by nodes that predate
unit support.

UCS is deliberately left alone, since its size options require the
unit suffix and would reject a bare byte count.

Assisted-by: Claude Code:claude-opus-5

Patch by Alexandre Viau; reviewed by TODO for CASSANDRA-21617
@aviau
aviau force-pushed the aviau/stcs-min-size branch from 6a31cec to 208d12e Compare August 27, 2026 21:59
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