You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Derek Bromenshenkel (JIRA)" <ji...@apache.org> on 2012/11/28 06:46:58 UTC

[jira] [Commented] (CASSANDRA-4996) After changing the compaction strategy, compression_strategy always returning back to the "SnappyCompressor" through CQL 2.2.0

    [ https://issues.apache.org/jira/browse/CASSANDRA-4996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13505235#comment-13505235 ] 

Derek Bromenshenkel commented on CASSANDRA-4996:
------------------------------------------------

I've run into this in the past, also.

It was introduced in 1.1 when compression was turned on by default.  The problem is that CFPropDefs class is shared by both CREATE and ALTER statements' code path and to provide the "default on" functionality, the sstable_compression value is statically set inside this class.  Then, because the ALTER statement provided does not define the value (and thus override the default), it ends up switching it back to the default.  This is also present in CQL 3 as far as I know.  I think the fix will be to remove the defaulting from CFPropDefs and add it over in the CREATE code path, since that is where the "default on" behavior is needed.

Also, notice that on your ALTER command, it did not actually change the compaction_strategy_class as you requested, but that is probably another issue.
                
> After changing the compaction strategy, compression_strategy  always returning back to the "SnappyCompressor" through CQL 2.2.0
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-4996
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4996
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.5
>            Reporter: Shamim Ahmed
>            Priority: Trivial
>             Fix For: 1.1.7
>
>
> faced very strange behaviour when changing compression_parameters of exisiting CF. After changing the compaction strategy, compression_strategy returning back to the "SnappyCompressor".
> Using cassandra version 1.1.5.
> [cqlsh 2.2.0 | Cassandra 1.1.5 | CQL spec 2.0.0 | Thrift protocol 19.32.0]
> I have one column family with following paramters:
> cqlsh > describe columnfamily auditlog_01;
> CREATE TABLE auditlog_01 (
> lid text PRIMARY KEY,
> dscn text,
> asid text,
> soapa text
> ) WITH
> comment='' AND
> comparator=text AND
> read_repair_chance=0.100000 AND
> gc_grace_seconds=864000 AND
> default_validation=text AND
> min_compaction_threshold=4 AND
> max_compaction_threshold=32 AND
> replicate_on_write='true' AND
> compaction_strategy_class='SizeTieredCompactionStrategy' AND
> compaction_strategy_options:sstable_size_in_mb='5' AND
> compression_parameters:sstable_compression='SnappyCompressor';
> Changing compression strategy to 'DeflateCompressor
> cqlsh> ALTER TABLE auditlog_01 WITH compression_parameters:sstabl
> e_compression = 'DeflateCompressor' AND compression_parameters:chunk_length_kb =
>  64;
> cqlsh> describe columnfamily auditlog_01;
> CREATE TABLE auditlog_01 (
> lid text PRIMARY KEY,
> dscn text,
> asid text,
> soapa text
> ) WITH
>   comment='' AND
>   comparator=text AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=text AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compaction_strategy_options:sstable_size_in_mb='5' AND
>   compression_parameters:chunk_length_kb='64' AND
>   compression_parameters:sstable_compression='DeflateCompressor';
> it's sucessfuly changed the compression strategy to 'DeflateCompressor, after that when i am trying to change the compaction strategy, compression strategy returing back to "SnappyCompressor".
> cqlsh> alter table auditlog_01 with compaction_strategy_class='Le
> veledCompactionStrategy' AND compaction_strategy_options:sstable_size_in_mb=5;
> cqlsh> describe columnfamily auditlog_01;
> CREATE TABLE auditlog_01 (
>   lid text PRIMARY KEY,
> dscn text,
> asid text,
> soapa text
> ) WITH
>   comment='' AND
>   comparator=text AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=text AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compaction_strategy_options:sstable_size_in_mb='5' AND
>   compression_parameters:sstable_compression='SnappyCompressor';

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira