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

Fix dropping columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1 beta1
    • Legacy/CQL
    • None
    • Normal

    Description

      Using ccqlsh, I issue a statement to drop a column from a table, and the session appears to disconnect.

      The statement was:

      cqlsh:taskapp> alter table user_task drop task_order;
      

      Here's the full setup I used:

      ccm create test_cluster
      ccm populate -n 3
      ccm start
      ccm node1 cqlsh
      
      CREATE KEYSPACE taskapp WITH replication = {
        'class': 'SimpleStrategy',
        'replication_factor': '3'
      };
      
      use taskapp;
      
      create table user (
          user_id timeuuid PRIMARY KEY,
          first_name text,
          last_name text,
          email text
      );
      
      create table user_task (
          task_id timeuuid PRIMARY KEY,
          user_id timeuuid,
          task_order int,
          task_description text,
          is_complete boolean,
          is_top_level boolean,
          subtask_ids list<timeuuid>
      );
      

      and then the statement which triggers the disconnect:

      cqlsh:taskapp> alter table user_task drop task_order;
      TSocket read 0 bytes
      TSocket read 0 bytes
      cqlsh:taskapp> describe table user_task;
      
      [Errno 32] Broken pipe
      

      The log for the active node shows this INFO, followed immediately by an exception (included below). The other nodes show no relevant messages:

      INFO  [Thrift:4] 2013-12-20 16:04:58,668 MigrationManager.java:263 - Update ColumnFamily 'taskapp/user_task' From org.apache.cassandra.config.CFMetaData@15e4ed88[cfId=df7153ac-c309-3bd2-92c2-e05bb53153fb,ksName=taskapp,cfName=user_task,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.ColumnToCollectionType(7375627461736b5f696473:org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.TimeUUIDType))),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.TimeUUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata={java.nio.HeapByteBuffer[pos=0 lim=11 cap=11]=ColumnDefinition{name=subtask_ids, type=org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.TimeUUIDType), kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=11 cap=11]=ColumnDefinition{name=is_complete, type=org.apache.cassandra.db.marshal.BooleanType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]=ColumnDefinition{name=is_top_level, type=org.apache.cassandra.db.marshal.BooleanType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=task_id, type=org.apache.cassandra.db.marshal.TimeUUIDType, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=10 cap=10]=ColumnDefinition{name=task_order, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=user_id, type=org.apache.cassandra.db.marshal.TimeUUIDType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=16 cap=16]=ColumnDefinition{name=task_description, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}},compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={},triggers={}] To org.apache.cassandra.config.CFMetaData@3568f812[cfId=df7153ac-c309-3bd2-92c2-e05bb53153fb,ksName=taskapp,cfName=user_task,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.ColumnToCollectionType(7375627461736b5f696473:org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.TimeUUIDType))),comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,replicateOnWrite=true,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.TimeUUIDType,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata={java.nio.HeapByteBuffer[pos=0 lim=11 cap=11]=ColumnDefinition{name=subtask_ids, type=org.apache.cassandra.db.marshal.ListType(org.apache.cassandra.db.marshal.TimeUUIDType), kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=11 cap=11]=ColumnDefinition{name=is_complete, type=org.apache.cassandra.db.marshal.BooleanType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]=ColumnDefinition{name=is_top_level, type=org.apache.cassandra.db.marshal.BooleanType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=task_id, type=org.apache.cassandra.db.marshal.TimeUUIDType, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=user_id, type=org.apache.cassandra.db.marshal.TimeUUIDType, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}, java.nio.HeapByteBuffer[pos=0 lim=16 cap=16]=ColumnDefinition{name=task_description, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=0, indexName=null, indexType=null}},compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionOptions={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtable_flush_period_in_ms=0,caching=KEYS_ONLY,defaultTimeToLive=0,speculative_retry=99.0PERCENTILE,indexInterval=128,populateIoCacheOnFlush=false,droppedColumns={task_order=1387580698664000},triggers={}]
      ERROR [Thrift:4] 2013-12-20 16:04:58,672 CustomTThreadPoolServer.java:212 - Error occurred during processing of message.
      java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map
      	at org.apache.cassandra.serializers.MapSerializer.serialize(MapSerializer.java:27) ~[main/:na]
      	at org.apache.cassandra.db.marshal.AbstractType.decompose(AbstractType.java:71) ~[main/:na]
      	at org.apache.cassandra.db.CFRowAdder.add(CFRowAdder.java:78) ~[main/:na]
      	at org.apache.cassandra.db.CFRowAdder.addMapEntry(CFRowAdder.java:65) ~[main/:na]
      	at org.apache.cassandra.config.CFMetaData.toSchemaNoColumnsNoTriggers(CFMetaData.java:1610) ~[main/:na]
      	at org.apache.cassandra.config.CFMetaData.toSchemaUpdate(CFMetaData.java:1483) ~[main/:na]
      	at org.apache.cassandra.service.MigrationManager.announceColumnFamilyUpdate(MigrationManager.java:264) ~[main/:na]
      	at org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:217) ~[main/:na]
      	at org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:71) ~[main/:na]
      	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:194) ~[main/:na]
      	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:228) ~[main/:na]
      	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:218) ~[main/:na]
      	at org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1966) ~[main/:na]
      	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4486) ~[thrift/:na]
      	at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4470) ~[thrift/:na]
      	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) ~[libthrift-0.9.1.jar:0.9.1]
      	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39) ~[libthrift-0.9.1.jar:0.9.1]
      	at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:194) ~[main/:na]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
      	at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
      

      Attachments

        1. trunk-6520.patch
          2 kB
          Mikhail Stepura

        Issue Links

          Activity

            People

              mishail Mikhail Stepura
              rhatch Russ Hatch
              Mikhail Stepura
              Aleksey Yeschenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: