You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "smiklosovic (via GitHub)" <gi...@apache.org> on 2026/09/03 14:25:34 UTC
[PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
smiklosovic opened a new pull request, #5100:
URL: https://github.com/apache/cassandra/pull/5100
Thanks for sending a pull request! Here are some tips if you're new here:
* Ensure you have added or run the [appropriate tests](https://cassandra.apache.org/_/development/testing.html) for your PR.
* Be sure to keep the PR description updated to reflect all changes.
* Write your PR title to summarize what this PR proposes.
* If possible, provide a concise example to reproduce the issue for a faster review.
* Read our [contributor guidelines](https://cassandra.apache.org/_/development/index.html)
* If you're making a documentation change, see our [guide to documentation contribution](https://cassandra.apache.org/_/development/documentation.html)
Commit messages should follow the following format:
```
<One sentence description, usually Jira title or CHANGES.txt summary>
<Optional lengthier description (context on patch)>
patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####
Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>
```
The [Cassandra Jira](https://issues.apache.org/jira/projects/CASSANDRA/issues/)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on code in PR #5100:
URL: https://github.com/apache/cassandra/pull/5100#discussion_r3949092379
##########
src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:
##########
@@ -679,7 +679,7 @@ private TableParams validateAndUpdateTransactionalMigration(boolean isCounter, T
@Override
public boolean compatibleWith(ClusterMetadata metadata)
{
- return metadata.directory.commonSerializationVersion.isAtLeast(Version.V0);
+ return metadata.directory.commonSerializationVersion.isAtLeast(attrs.minimumSerializationVersion());
Review Comment:
yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on code in PR #5100:
URL: https://github.com/apache/cassandra/pull/5100#discussion_r4004054329
##########
pylib/cqlshlib/cql3handling.py:
##########
@@ -568,6 +569,8 @@ def cf_prop_val_completer(ctxt, cass):
return [Hint('<true|false>')]
if this_opt in ('read_repair'):
return [Hint('<\'none\'|\'blocking\'>')]
+ if this_opt == 'flush_compression':
+ return ["'auto'", "'none'", "'fast'", "'table'"]
Review Comment:
I think we might do `[Hint('<\'auto\'|\'none\'|\'fast\'|\'table\'>')]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on code in PR #5100:
URL: https://github.com/apache/cassandra/pull/5100#discussion_r3949115540
##########
src/java/org/apache/cassandra/io/sstable/format/DataComponent.java:
##########
@@ -143,23 +144,20 @@ && isDirectWriteSupported(operationType))
*
* @return {@link CompressionParams}
*/
- private static CompressionParams buildCompressionParams(TableMetadata metadata, OperationType operationType, FlushCompression flushCompression)
+ @VisibleForTesting
+ static CompressionParams buildCompressionParams(TableMetadata metadata, OperationType operationType, FlushCompression flushCompression)
{
CompressionParams compressionParams = metadata.params.compression;
+ FlushCompressionParams flushCompressionParams = metadata.params.flushCompression;
final ICompressor compressor = compressionParams.getSstableCompressor();
if (null != compressor && operationType == OperationType.FLUSH)
{
- // When we are flushing out of the memtable throughput of the compressor is critical as flushes,
- // especially of large tables, can queue up and potentially block writes.
- // This optimization allows us to fall back to a faster compressor if a particular
- // compression algorithm indicates we should. See CASSANDRA-15379 for more details.
- switch (flushCompression)
+ switch (flushCompressionParams.configurationKey)
{
- // It is relatively easier to insert a Noop compressor than to disable compressed writing
- // entirely as the "compression" member field is provided outside the scope of this class.
- // It may make sense in the future to refactor the ownership of the compression flag so that
- // We can bypass the CompressedSequentialWriter in this case entirely.
+ case auto:
Review Comment:
yeah, I think we need that, also to be aligned with what is in yaml. `fast` is in this case and also in `auto` logic in `resolveCompressionParams`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
Posted by "bbotella (via GitHub)" <gi...@apache.org>.
bbotella commented on code in PR #5100:
URL: https://github.com/apache/cassandra/pull/5100#discussion_r3948968500
##########
src/java/org/apache/cassandra/io/sstable/format/DataComponent.java:
##########
@@ -143,23 +144,20 @@ && isDirectWriteSupported(operationType))
*
* @return {@link CompressionParams}
*/
- private static CompressionParams buildCompressionParams(TableMetadata metadata, OperationType operationType, FlushCompression flushCompression)
+ @VisibleForTesting
+ static CompressionParams buildCompressionParams(TableMetadata metadata, OperationType operationType, FlushCompression flushCompression)
{
CompressionParams compressionParams = metadata.params.compression;
+ FlushCompressionParams flushCompressionParams = metadata.params.flushCompression;
final ICompressor compressor = compressionParams.getSstableCompressor();
if (null != compressor && operationType == OperationType.FLUSH)
{
- // When we are flushing out of the memtable throughput of the compressor is critical as flushes,
- // especially of large tables, can queue up and potentially block writes.
- // This optimization allows us to fall back to a faster compressor if a particular
- // compression algorithm indicates we should. See CASSANDRA-15379 for more details.
- switch (flushCompression)
+ switch (flushCompressionParams.configurationKey)
{
- // It is relatively easier to insert a Noop compressor than to disable compressed writing
- // entirely as the "compression" member field is provided outside the scope of this class.
- // It may make sense in the future to refactor the ownership of the compression flag so that
- // We can bypass the CompressedSequentialWriter in this case entirely.
+ case auto:
Review Comment:
Do we need a case for "fast"?
##########
pylib/cqlshlib/cql3handling.py:
##########
@@ -568,6 +569,8 @@ def cf_prop_val_completer(ctxt, cass):
return [Hint('<true|false>')]
if this_opt in ('read_repair'):
return [Hint('<\'none\'|\'blocking\'>')]
+ if this_opt == 'flush_compression':
+ return ["'auto'", "'none'", "'fast'", "'table'"]
Review Comment:
Do we want to hard code this on the parser.g?
##########
src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:
##########
@@ -679,7 +679,7 @@ private TableParams validateAndUpdateTransactionalMigration(boolean isCounter, T
@Override
public boolean compatibleWith(ClusterMetadata metadata)
{
- return metadata.directory.commonSerializationVersion.isAtLeast(Version.V0);
+ return metadata.directory.commonSerializationVersion.isAtLeast(attrs.minimumSerializationVersion());
Review Comment:
Is this change related?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21642 Consider the introduction of flush_compression CQL table parameter [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on code in PR #5100:
URL: https://github.com/apache/cassandra/pull/5100#discussion_r3949094673
##########
pylib/cqlshlib/cql3handling.py:
##########
@@ -568,6 +569,8 @@ def cf_prop_val_completer(ctxt, cass):
return [Hint('<true|false>')]
if this_opt in ('read_repair'):
return [Hint('<\'none\'|\'blocking\'>')]
+ if this_opt == 'flush_compression':
+ return ["'auto'", "'none'", "'fast'", "'table'"]
Review Comment:
why not?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org