You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksey Yeschenko (JIRA)" <ji...@apache.org> on 2016/08/02 17:26:20 UTC

[jira] [Commented] (CASSANDRA-12335) Super columns are broken after upgrading to 3.0

    [ https://issues.apache.org/jira/browse/CASSANDRA-12335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404431#comment-15404431 ] 

Aleksey Yeschenko commented on CASSANDRA-12335:
-----------------------------------------------

The first issue is that we have a bug in {{LegacySchemaMigrator::calculateIsDense()}} that does not correctly recognise the denseness of the table. Fixing it is unfortunately not enough, however. The returned resultset is still incorrect, exposing the internal super column map. I believe {{compound}} flag should also be set here, as the full 2.1 comparator is compound. But even with that, the internal column is still being exposed, but the {{value}} column is null. At least {{SelectStatement}} needs to be modified as well.


2.1, correct output:

{noformat}
cqlsh:test> select * from "Sites";

key          | column1    | column2 | value
--------------+------------+---------+--------------
 0x53696d6f6e | 0x61747472 |    name | 0x53696d6f6e
     0x426f62 | 0x61747472 |    name |     0x426f62
{noformat}

3.0 HEAD:

{noformat}
cqlsh:test> select * from "Sites";

 key          | column1                        |
--------------+--------------------------------+------------------------
 0x53696d6f6e | 0x0004617474720000046e616d6500 | {'name': 0x53696d6f6e}
     0x426f62 | 0x0004617474720000046e616d6500 |     {'name': 0x426f62}
{noformat}

3.0, with {{dense}} flag correctly preserved:

{noformat}
cqlsh:test> select * from "Sites";

 key          | column1                        | column2 |                        | value
--------------+--------------------------------+---------+------------------------+-------
 0x53696d6f6e | 0x0004617474720000046e616d6500 |    null | {'name': 0x53696d6f6e} |  null
     0x426f62 | 0x0004617474720000046e616d6500 |    null |     {'name': 0x426f62} |  null
{noformat}

3.0, with both {{dense}} and {{compound}} flags preserved:

{noformat}
cqlsh:test> select * from "Sites";

 key          | column1    | column2 |                        | value
--------------+------------+---------+------------------------+-------
 0x53696d6f6e | 0x61747472 |    name | {'name': 0x53696d6f6e} |  null
     0x426f62 | 0x61747472 |    name |     {'name': 0x426f62} |  null
{noformat}

[~slebresne] do you mind having a look?

> Super columns are broken after upgrading to 3.0
> -----------------------------------------------
>
>                 Key: CASSANDRA-12335
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12335
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Jeremiah Jordan
>            Assignee: Aleksey Yeschenko
>             Fix For: 3.0.x, 3.x
>
>
> Super Columns are broken after upgrading to cassandra-3.0 HEAD.  The below script shows this.
> 2.1 cli output for get:
> {code}
> [default@test] get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;
> => (name=name, value=Bob, timestamp=1469724504357000)
> {code}
> cqlsh:
> {code}
> [default@test]
>  key          | blobAsText(column1)
> --------------+---------------------
>  0x53696d6f6e |                attr
>      0x426f62 |                attr
> {code}
> 3.0 cli:
> {code}
> [default@unknown] use test;
> unconfigured table schema_columnfamilies
> [default@test] get Sites[utf8('Bob')][utf8('attr')]['name'] as utf8;
> null
> [default@test]
> {code}
> cqlsh:
> {code}
>  key          | system.blobastext(column1)
> --------------+----------------------------------
>  0x53696d6f6e | \x00\x04attr\x00\x00\x04name\x00
>      0x426f62 | \x00\x04attr\x00\x00\x04name\x00
> {code}
> Run this from a directory with cassandra-3.0 checked out and compiled
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)