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

Super columns are broken after upgrading to 3.0 on thrift

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 3.0.9, 3.8
    • Component/s: Legacy/Core
    • Labels:
      None
    • Severity:
      Normal

      Description

      Super Columns are broken after upgrading to cassandra-3.0 HEAD. The below script shows this.

      2.1 cli output for get:

      [default@test] get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;
      => (name=name, value=Bob, timestamp=1469724504357000)
      

      cqlsh:

      [default@test]
       key          | blobAsText(column1)
      --------------+---------------------
       0x53696d6f6e |                attr
           0x426f62 |                attr
      

      3.0 cli:

      [default@unknown] use test;
      unconfigured table schema_columnfamilies
      [default@test] get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;
      null
      [default@test]
      

      cqlsh:

       key          | system.blobastext(column1)
      --------------+----------------------------------
       0x53696d6f6e | \x00\x04attr\x00\x00\x04name\x00
           0x426f62 | \x00\x04attr\x00\x00\x04name\x00
      

      Run this from a directory with cassandra-3.0 checked out and compiled

      ccm create -n 2 -v 2.1.14 testsuper
      echo "####################### Starting 2.1 #######################"
      ccm start
      
      MYFILE=`mktemp`
      echo "create keyspace test with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = {replication_factor:2};
      use test;
      create column family Sites with column_type = 'Super' and comparator = 'BytesType' and subcomparator='UTF8Type';
      set Sites[utf8('Simon')][utf8('attr')]['name'] = utf8('Simon');
      set Sites[utf8('Bob')][utf8('attr')]['name'] = utf8('Bob');
      get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;" > $MYFILE
      
      ~/.ccm/repository/2.1.14/bin/cassandra-cli < $MYFILE
      rm $MYFILE
      
      ~/.ccm/repository/2.1.14/bin/nodetool -p 7100 flush
      ~/.ccm/repository/2.1.14/bin/nodetool -p 7200 flush
      ccm stop
      
      # run from cassandra-3.0 checked out and compiled
      ccm setdir
      echo "####################### Starting Current Directory #######################"
      ccm start
      
      ./bin/nodetool -p 7100 upgradesstables
      ./bin/nodetool -p 7200 upgradesstables
      
      ./bin/nodetool -p 7100 enablethrift
      ./bin/nodetool -p 7200 enablethrift
      
      MYFILE=`mktemp`
      echo "use test;
      get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;" > $MYFILE
      
      
      ~/.ccm/repository/2.1.14/bin/cassandra-cli < $MYFILE
      
      rm $MYFILE
      

        Attachments

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne
              Reporter:
              jjordan Jeremiah Jordan
              Authors:
              Sylvain Lebresne
              Reviewers:
              Aleksey Yeschenko
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: