cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shuler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8000) Schema Corruption when 1.2.15->2.0.9 rolling upgrade and in mixed mode
Date Wed, 24 Sep 2014 21:34:34 GMT

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

Michael Shuler commented on CASSANDRA-8000:
-------------------------------------------

reproduced 1.2.15 -> 2.0.9
I'm going to try the latest branch versions.

{noformat}
mshuler@hana:~$ ccm create 8000 -n2 -v 1.2.15
Current cluster is now: 8000
mshuler@hana:~$ ccm start
mshuler@hana:~$ ccm node1 cqlsh
Connected to 8000 at 127.0.0.1:9160.
[cqlsh 3.1.8 | Cassandra 1.2.15-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.36.2]
Use HELP for help.
cqlsh> CREATE KEYSPACE testkeyspace WITH replication = {
   ...   'class': 'SimpleStrategy',
   ...   'replication_factor':2
   ... };
cqlsh> 
cqlsh> USE testkeyspace;
cqlsh:testkeyspace> 
cqlsh:testkeyspace> CREATE TABLE test (
                ...   testid timeuuid PRIMARY KEY,
                ...   businesskey timestamp,
                ...   createdby text,
                ...   createdtimestamp timestamp,
                ...   testname text
                ... ) ;
cqlsh:testkeyspace> 
cqlsh:testkeyspace> 
cqlsh:testkeyspace> insert into test(testid,businesskey,createdby,createdtimestamp,testname)
VALUES (now(),dateOf(now()),'user',dateOf(now()),'test');
cqlsh:testkeyspace> 
cqlsh:testkeyspace> SELECT * FROM test;

 testid                               | businesskey              | createdby | createdtimestamp
        | testname
--------------------------------------+--------------------------+-----------+--------------------------+----------
 426a5a70-4431-11e4-b66e-25721e450b6c | 2014-09-24 16:25:08-0500 |      user | 2014-09-24
16:25:08-0500 |     test

cqlsh:testkeyspace> 
mshuler@hana:~$ ccm node1 nodetool snapshot
Requested creating snapshot for: all keyspaces 
Snapshot directory: 1411593969432
mshuler@hana:~$ ccm node1 nodetool decommission
mshuler@hana:~$ ccm node1 stop
mshuler@hana:~$ ccm node1 setdir --cassandra-version 2.0.9
mshuler@hana:~$ ccm node1 start
mshuler@hana:~$ ccm node1 cqlsh
Connected to 8000 at 127.0.0.1:9160.
[cqlsh 4.1.1 | Cassandra 2.0.9-SNAPSHOT | CQL spec 3.1.1 | Thrift protocol 19.39.0]
Use HELP for help.
cqlsh> DESC TABLE testkeyspace.test;

CREATE TABLE test (
  testid timeuuid,
  businesskey timestamp,
  createdby text,
  createdtimestamp timestamp,
  testname text,
  PRIMARY KEY ((testid))
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

cqlsh> SELECT * FROM testkeyspace.test;

 testid                               | businesskey              | createdby | createdtimestamp
        | testname
--------------------------------------+--------------------------+-----------+--------------------------+----------
 426a5a70-4431-11e4-b66e-25721e450b6c | 2014-09-24 16:25:08-0500 |      user | 2014-09-24
16:25:08-0500 |     test

(1 rows)

cqlsh> 
mshuler@hana:~$ ccm node2 cqlsh
Connected to 8000 at 127.0.0.2:9160.
[cqlsh 3.1.8 | Cassandra 1.2.15-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.36.2]
Use HELP for help.
cqlsh> DESC TABLE testkeyspace.test;

CREATE TABLE test (
  testid timeuuid PRIMARY KEY,
  businesskey timestamp,
  createdby text,
  createdtimestamp timestamp,
  testid timeuuid,
  testname text
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};

cqlsh> SELECT * FROM testkeyspace.test;

 testid                               | testid | businesskey              | createdby | createdtimestamp
        | testname
--------------------------------------+--------+--------------------------+-----------+--------------------------+----------
 426a5a70-4431-11e4-b66e-25721e450b6c |   null | 2014-09-24 16:25:08-0500 |      user | 2014-09-24
16:25:08-0500 |     test

cqlsh> 
mshuler@hana:~$
{noformat}

> Schema Corruption when 1.2.15->2.0.9 rolling upgrade and in mixed mode
> ----------------------------------------------------------------------
>
>                 Key: CASSANDRA-8000
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8000
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Yeshvanthni
>
> Steps to reproduce:
> 1. Setup multi-node Cassandra 1.2.15 with following schema 
> {code}
> CREATE KEYSPACE testkeyspace WITH replication = {
>   'class': 'SimpleStrategy',
>   'replication_factor':2
> };
> USE testkeyspace;
> CREATE TABLE test (
>   testid timeuuid PRIMARY KEY,
>   businesskey timestamp,
>   createdby text,
>   createdtimestamp timestamp,
>   testname text
> ) ;
> insert into test(testid,businesskey,createdby,createdtimestamp,testname) VALUES (now(),dateOf(now()),'user',dateOf(now()),'test');
> {code}
> 2. Roll one node to Cassandra 2.0.9 
>          - Snapshot 1.2.15 
>          - Decommission the old 1.2.15
>          - Start Cassandra 2.0.9 pointing to the same data folder  as 1.2.15
>          - nodetool upgradesstables 
> 3. Query against 1.2.15 nodes of the cluster with CQLSH
> It returns an additional primary key column with null value in it. Describe shows that
the table has somehow got the additional column
> {code}
> CREATE TABLE test (
>   testid timeuuid PRIMARY KEY,
>   testid timeuuid,
>   businesskey timestamp,
>   createdby text,
>   createdtimestamp timestamp,
>   testname text
> ) ;
> {code}
> Observation:
> This could be because of the change in Cassandra 2.x to store all columns including the
key columns in schema_columns while earlier key columns were stored schema_columnfamilies.
> This blocks rolling upgrades and fails the cluster when in mixed mode.



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

Mime
View raw message