Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-3391

CFM.toAvro() incorrectly serialises key_validation_class defn

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.8.8, 1.0.1
    • None
    • None
    • Low

    Description

      see http://www.mail-archive.com/user@cassandra.apache.org/msg18132.html

      Repo with

      create keyspace Stats with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options={replication_factor:1};
      
      use Stats;
      
      create column family Sample_Stats with default_validation_class=CounterColumnType
          and key_validation_class='CompositeType(UTF8Type,UTF8Type)'
          and comparator='CompositeType(UTF8Type, UTF8Type)'
          and replicate_on_write=true;
      
      [default@Stats] describe cluster;
      Cluster Information:
         Snitch: org.apache.cassandra.locator.SimpleSnitch
         Partitioner: org.apache.cassandra.dht.RandomPartitioner
         Schema versions: 
      	1d39bbf0-fb60-11e0-0000-242d50cf1ffd: [127.0.0.1]
      

      Stop and restart the node

      ERROR 10:12:22,729 Exception encountered during startup
      java.lang.RuntimeException: Could not inflate CFMetaData for {"keyspace": "Stats", "name": "Sample_Stats", "column_type": "Standard", "comparator_type": "org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)", "subcomparator_type": null, "comment": "", "row_cache_size": 0.0, "key_cache_size": 200000.0, "read_repair_chance": 1.0, "replicate_on_write": true, "gc_grace_seconds": 864000, "default_validation_class": "org.apache.cassandra.db.marshal.CounterColumnType", "key_validation_class": "org.apache.cassandra.db.marshal.CompositeType", "min_compaction_threshold": 4, "max_compaction_threshold": 32, "row_cache_save_period_in_seconds": 0, "key_cache_save_period_in_seconds": 14400, "row_cache_keys_to_save": 2147483647, "merge_shards_chance": 0.1, "id": 1000, "column_metadata": [], "row_cache_provider": "org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider", "key_alias": null, "compaction_strategy": "org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy", "compaction_strategy_options": {}, "compression_options": {}}
      	at org.apache.cassandra.config.CFMetaData.fromAvro(CFMetaData.java:362)
      	at org.apache.cassandra.config.KSMetaData.fromAvro(KSMetaData.java:193)
      	at org.apache.cassandra.db.DefsTable.loadFromStorage(DefsTable.java:99)
      	at org.apache.cassandra.config.DatabaseDescriptor.loadSchemas(DatabaseDescriptor.java:502)
      	at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:161)
      	at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:337)
      	at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:106)
      Caused by: org.apache.cassandra.config.ConfigurationException: Invalid definition for comparator org.apache.cassandra.db.marshal.CompositeType.
      	at org.apache.cassandra.db.marshal.TypeParser.getRawAbstractType(TypeParser.java:319)
      	at org.apache.cassandra.db.marshal.TypeParser.getAbstractType(TypeParser.java:247)
      	at org.apache.cassandra.db.marshal.TypeParser.parse(TypeParser.java:83)
      	at org.apache.cassandra.db.marshal.TypeParser.parse(TypeParser.java:92)
      	at org.apache.cassandra.config.CFMetaData.fromAvro(CFMetaData.java:358)
      	... 6 more
      Caused by: org.apache.cassandra.config.ConfigurationException: Nonsensical empty parameter list for CompositeType
      	at org.apache.cassandra.db.marshal.CompositeType.getInstance(CompositeType.java:67)
      	at org.apache.cassandra.db.marshal.CompositeType.getInstance(CompositeType.java:61)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.cassandra.db.marshal.TypeParser.getRawAbstractType(TypeParser.java:307)
      	... 10 more
      

      Will post the patch in a minute.

      Attachments

        1. 0001-3391-fix.patch
          1 kB
          Aaron Morton

        Activity

          People

            amorton Aaron Morton
            amorton Aaron Morton
            Aaron Morton
            Sylvain Lebresne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: