Cassandra
  1. Cassandra
  2. CASSANDRA-4842

DateType in Column MetaData causes server crash

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.1.7, 1.2.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      All

      Description

      when creating a column family with column metadata containing a date, there is a server crash that will prevent startup.

      To recreate from the cli:

      create keyspace test;
      use test;
      create column family foo
        with column_type = 'Standard'
        and comparator = 'CompositeType(LongType,DateType)'
        and default_validation_class = 'UTF8Type'
        and key_validation_class = 'UTF8Type'
        and column_metadata = [ 
          { column_name : '1234:1350695443433', validation_class : BooleanType} 
        ];
      

      Produces this error in the logs:

      ERROR 21:11:18,795 Error occurred during processing of message.
      java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a  formatted date (long)
      	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:373)
      	at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:194)
      	at org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:141)
      	at org.apache.cassandra.thrift.CassandraServer.system_add_column_family(CassandraServer.java:931)
      	at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3410)
      	at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3398)
      	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
      	at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
      	at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a  formatted date (long)
      	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:83)
      	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:369)
      	... 11 more
      Caused by: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a  formatted date (long)
      	at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
      	at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
      	at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
      	at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
      	at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
      	at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
      	at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
      	at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
      	at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
      	at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	... 3 more
      Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
      	at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
      	at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
      	... 14 more
      ERROR 21:11:18,795 Exception in thread Thread[MigrationStage:1,5,main]
      org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a  formatted date (long)
      	at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
      	at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
      	at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
      	at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
      	at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
      	at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
      	at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
      	at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
      	at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
      	at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
      	at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
      	at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
      	... 14 more
      

      This error is repeated when attempting to restart the server, and results in the server failing to start.

      1. 4842.txt
        8 kB
        Sylvain Lebresne

        Activity

        Russell Bradberry created issue -
        Russell Bradberry made changes -
        Field Original Value New Value
        Description when creating a column family with column metadata containing a date, there is a server crash that will prevent startup.

        To recreate from the cli:
        {code}
        create keyspace test;
        use test;
        create column family foo
          with column_type = 'Standard'
          and comparator = 'CompositeType(LongType,DateType)'
          and default_validation_class = 'UTF8Type'
          and key_validation_class = 'UTF8Type'
          and column_metadata = [
            { column_name : '1234:1350695443433', validation_class : BooleanType}
          ];
        {code}

        Produces this error in the logs:

        {code}
        ERROR 21:11:18,795 Error occurred during processing of message.
        java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:373)
        at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:194)
        at org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:141)
        at org.apache.cassandra.thrift.CassandraServer.system_add_column_family(CassandraServer.java:931)
        at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3410)
        at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3398)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
        at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
        at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:369)
        ... 11 more
        Caused by: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
        at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
        at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
        at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
        at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
        at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
        at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
        at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
        at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
        at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        ... 3 more
        Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
        at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
        ... 14 more
        ERROR 21:11:18,795 Exception in thread Thread[MigrationStage:1,5,main]
        org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
        at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
        at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
        at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
        at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
        at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
        at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
        at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
        at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
        at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
        at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
        ... 14 more
        {code}

        when creating a column family with column metadata containing a date, there is a server crash that will prevent startup.

        To recreate from the cli:
        {code}
        create keyspace test;
        use test;
        create column family foo
          with column_type = 'Standard'
          and comparator = 'CompositeType(LongType,DateType)'
          and default_validation_class = 'UTF8Type'
          and key_validation_class = 'UTF8Type'
          and column_metadata = [
            { column_name : '1234:1350695443433', validation_class : BooleanType}
          ];
        {code}

        Produces this error in the logs:

        {code}
        ERROR 21:11:18,795 Error occurred during processing of message.
        java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:373)
        at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:194)
        at org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:141)
        at org.apache.cassandra.thrift.CassandraServer.system_add_column_family(CassandraServer.java:931)
        at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3410)
        at org.apache.cassandra.thrift.Cassandra$Processor$system_add_column_family.getResult(Cassandra.java:3398)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
        at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.util.concurrent.ExecutionException: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
        at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:369)
        ... 11 more
        Caused by: org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
        at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
        at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
        at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
        at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
        at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
        at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
        at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
        at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
        at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        ... 3 more
        Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
        at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
        ... 14 more
        ERROR 21:11:18,795 Exception in thread Thread[MigrationStage:1,5,main]
        org.apache.cassandra.db.marshal.MarshalException: unable to coerce '2012-10-19 21' to a formatted date (long)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:117)
        at org.apache.cassandra.db.marshal.DateType.fromString(DateType.java:85)
        at org.apache.cassandra.db.marshal.AbstractCompositeType.fromString(AbstractCompositeType.java:213)
        at org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:257)
        at org.apache.cassandra.config.CFMetaData.addColumnDefinitionSchema(CFMetaData.java:1318)
        at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1250)
        at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:299)
        at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:434)
        at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:346)
        at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:217)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:680)
        Caused by: java.text.ParseException: Unable to parse the date: 2012-10-19 21
        at org.apache.commons.lang.time.DateUtils.parseDate(DateUtils.java:285)
        at org.apache.cassandra.db.marshal.DateType.dateStringToTimestamp(DateType.java:113)
        ... 14 more
        {code}

        This error is repeated when attempting to restart the server, and results in the server failing to start.
        Jonathan Ellis made changes -
        Assignee Aleksey Yeschenko [ iamaleksey ]
        Fix Version/s 1.1.7 [ 12323354 ]
        Fix Version/s 1.2.0 beta 2 [ 12323284 ]
        Affects Version/s 1.1.0 [ 12317615 ]
        Affects Version/s 1.2.0 beta 1 [ 12319262 ]
        Affects Version/s 1.1.5 [ 12322941 ]
        Affects Version/s 1.1.6 [ 12323257 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Reviewer jbellis
        Jonathan Ellis made changes -
        Assignee Aleksey Yeschenko [ iamaleksey ] Pavel Yaskevich [ xedin ]
        Pavel Yaskevich made changes -
        Assignee Pavel Yaskevich [ xedin ] Sylvain Lebresne [ slebresne ]
        Jonathan Ellis made changes -
        Fix Version/s 1.2.0 [ 12323243 ]
        Fix Version/s 1.2.0 beta 2 [ 12323284 ]
        Sylvain Lebresne made changes -
        Attachment 4842.txt [ 12550448 ]
        Sylvain Lebresne made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Sylvain Lebresne made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12730722 ] patch-available, re-open possible [ 12753571 ]
        Gavin made changes -
        Workflow patch-available, re-open possible [ 12753571 ] reopen-resolved, no closed status, patch-avail, testing [ 12758817 ]

          People

          • Assignee:
            Sylvain Lebresne
            Reporter:
            Russell Bradberry
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development