Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Won't Fix
-
None
-
Low
Description
After upgrading from Cassandra 2.0.6.4 to Cassandra 2.1.2-SNAPSHOT, the Thrift CLI client started reporting wrong default_validation_class for a Column Family.
For example,
[default@MyKeyspace] show schema; [...] create column family SomeColumnFamily with column_type = 'Standard' and comparator = 'BytesType' and default_validation_class = 'BytesType' and key_validation_class = 'BytesType' and read_repair_chance = 0.1 and dclocal_read_repair_chance = 0.0 and gc_grace = 10800 and min_compaction_threshold = 4 and max_compaction_threshold = 32 and compaction_strategy = 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy' and caching = 'KEYS_ONLY' and cells_per_row_to_cache = '0' and default_time_to_live = 0 and speculative_retry = 'NONE' and compaction_strategy_options = {'tombstone_compaction_interval' : '300', 'sstable_size_in_mb' : '200', 'tombstone_threshold' : '0.1'} and compression_options = {'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor'};
but
[default@MyKeyspace] describe SomeColumnFamily; WARNING: CQL3 tables are intentionally omitted from 'describe' output. See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details. ColumnFamily: SomeColumnFamily Key Validation Class: org.apache.cassandra.db.marshal.BytesType Default column value validator: org.apache.cassandra.db.marshal.UTF8Type Cells sorted by: org.apache.cassandra.db.marshal.UTF8Type GC grace seconds: 10800 Compaction min/max thresholds: 4/32 Read repair chance: 0.1 DC Local Read repair chance: 0.0 Caching: KEYS_ONLY Default time to live: 0 Bloom Filter FP chance: default Index interval: default Speculative Retry: NONE Built indexes: [] Compaction Strategy: org.apache.cassandra.db.compaction.LeveledCompactionStrategy Compaction Strategy Options: tombstone_compaction_interval: 300 sstable_size_in_mb: 200 tombstone_threshold: 0.1 Compression Options: sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor
Note how the default column value validator and cell sorting is UTF8Type rather than the BytesType reported earlier.
If I populate the column family and list its rows, I get
[default@MyKeyspace] list SomeColumnFamily; Using default limit of 100 Using default cell limit of 100 ------------------- RowKey: SomeRowKey String didn't validate.
I can't see the row. I can temporarily fix this by setting the default_column_validator
[default@MyKeyspace] update column family SomeColumnFamily with default_validation_class = BytesType; 0fba13e4-aac6-3963-ad65-ba354d99ebdc [default@MyKeyspace] list SomeColumnFamily; Using default limit of 100 Using default cell limit of 100 ------------------- RowKey: SomeRowKey => (name=some name, value=some value, timestamp=635540144263687300) ------------------- [More RowKeys]
If I do a DESCRIBE again, though, LIST stops working again.
[default@KeySpace] describe SomeColumnFamily; WARNING: CQL3 tables are intentionally omitted from 'describe' output. See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details. ColumnFamily: SomeColumnFamily Key Validation Class: org.apache.cassandra.db.marshal.BytesType Default column value validator: org.apache.cassandra.db.marshal.UTF8Type Cells sorted by: org.apache.cassandra.db.marshal.UTF8Type GC grace seconds: 10800 Compaction min/max thresholds: 4/32 Read repair chance: 0.1 DC Local Read repair chance: 0.0 Caching: KEYS_ONLY Default time to live: 0 Bloom Filter FP chance: default Index interval: default Speculative Retry: NONE Built indexes: [] Compaction Strategy: org.apache.cassandra.db.compaction.LeveledCompactionStrategy Compaction Strategy Options: tombstone_compaction_interval: 300 sstable_size_in_mb: 200 tombstone_threshold: 0.1 Compression Options: sstable_compression: org.apache.cassandra.io.compress.SnappyCompressor [default@MyKeyspace] list SomeColumnFamily; Using default limit of 100 Using default cell limit of 100 ------------------- RowKey: SomeRowKey String didn't validate.
I can access the column family rows with other clients, the C# driver for example.
With C#
var keyspaceDef = pool.DescribeKeyspace ("MyKeyspace"); var cfDefs = keyspaceDef.Cf_defs; foreach (CfDef cfDef in cfDefs) { if (cfDef.Name == "SomeColumnFamily") { Console.WriteLine ("Default validation class: " + cfDef.Default_validation_class); Console.WriteLine ("Comparator type: " + cfDef.Comparator_type); Console.WriteLine ("Key validation class: " + cfDef.Key_validation_class); } }
outputs
Default validation class: org.apache.cassandra.db.marshal.BytesType Comparator type: org.apache.cassandra.db.marshal.BytesType Key validation class: org.apache.cassandra.db.marshal.BytesType