cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Stepura (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6831) Updates to COMPACT STORAGE tables via cli drop CQL information
Date Fri, 04 Apr 2014 20:28:40 GMT

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

Mikhail Stepura commented on CASSANDRA-6831:
--------------------------------------------

Here's what I've seen on the 2.1 branch.
The table was created in ``cqlsh``
{code:title=cqlsh}
[cqlsh 5.0.0 | Cassandra 2.1.0-beta1-SNAPSHOT | CQL spec 3.1.5 | Native protocol v2]
Use HELP for help.
cqlsh>
cqlsh>  CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor'
: 1 };
cqlsh> use test;
cqlsh:test> CREATE TABLE foo (bar text, baz text, qux text, PRIMARY KEY(bar, baz) ) WITH
COMPACT STORAGE;
cqlsh:test> DESCRIBE TABLE foo;

CREATE TABLE test.foo (
    bar text,
    baz text,
    qux text,
    PRIMARY KEY (bar, baz)
) WITH COMPACT STORAGE
    AND CLUSTERING ORDER BY (baz ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND populate_io_cache_on_flush = false
    AND read_repair_chance = 0.1
    AND speculative_retry = '99.0PERCENTILE'
{code}

Then I did the stuff in ``cassandra-cli``
{code:title=cassandra-cli}
mstepura-mac:cassandra mikhail$ bin/cassandra-cli
Connected to: "Test Cluster" on 127.0.0.1/9160
Welcome to Cassandra CLI version 2.1.0-beta1-SNAPSHOT

The CLI is deprecated and will be removed in Cassandra 3.0.  Consider migrating to cqlsh.
CQL is fully backwards compatible with Thrift data; see http://www.datastax.com/dev/blog/thrift-to-cql3

Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.

[default@unknown] use test;
Authenticated to keyspace: test
[default@test] UPDATE COLUMN FAMILY foo WITH comment='hey this is a comment';
org.apache.thrift.transport.TTransportException
{code}

Meanwhile in the logs
{code}
ERROR 20:14:17 Exception in thread Thread[MigrationStage:1,5,main]
java.lang.AssertionError: There shouldn't be more than one compact value defined: got ColumnDefinition{name=qux,
type=org.apache.cassandra.db.marshal.UTF8Type, kind=COMPACT_VALUE, componentIndex=null, indexName=null,
indexType=null} and ColumnDefinition{name=value, type=org.apache.cassandra.db.marshal.UTF8Type,
kind=COMPACT_VALUE, componentIndex=null, indexName=null, indexType=null}
	at org.apache.cassandra.config.CFMetaData.rebuild(CFMetaData.java:1981) ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.fromSchemaNoTriggers(CFMetaData.java:1751) ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1791) ~[main/:na]
	at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:320)
~[main/:na]
	at org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:306) ~[main/:na]
	at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:181) ~[main/:na]
	at org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:306)
~[main/:na]
	at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) ~[main/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_51]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51]
	at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
ERROR 20:14:17 Error occurred during processing of message.
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.AssertionError:
There shouldn't be more than one compact value defined: got ColumnDefinition{name=qux, type=org.apache.cassandra.db.marshal.UTF8Type,
kind=COMPACT_VALUE, componentIndex=null, indexName=null, indexType=null} and ColumnDefinition{name=value,
type=org.apache.cassandra.db.marshal.UTF8Type, kind=COMPACT_VALUE, componentIndex=null, indexName=null,
indexType=null}
	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:411) ~[main/:na]
	at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:288) ~[main/:na]
	at org.apache.cassandra.service.MigrationManager.announceColumnFamilyUpdate(MigrationManager.java:242)
~[main/:na]
	at org.apache.cassandra.thrift.CassandraServer.system_update_column_family(CassandraServer.java:1676)
~[main/:na]
	at org.apache.cassandra.thrift.Cassandra$Processor$system_update_column_family.getResult(Cassandra.java:4430)
~[thrift/:na]
	at org.apache.cassandra.thrift.Cassandra$Processor$system_update_column_family.getResult(Cassandra.java:4414)
~[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:201)
~[main/:na]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51]
	at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
Caused by: java.util.concurrent.ExecutionException: java.lang.AssertionError: There shouldn't
be more than one compact value defined: got ColumnDefinition{name=qux, type=org.apache.cassandra.db.marshal.UTF8Type,
kind=COMPACT_VALUE, componentIndex=null, indexName=null, indexType=null} and ColumnDefinition{name=value,
type=org.apache.cassandra.db.marshal.UTF8Type, kind=COMPACT_VALUE, componentIndex=null, indexName=null,
indexType=null}
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.7.0_51]
	at java.util.concurrent.FutureTask.get(FutureTask.java:188) ~[na:1.7.0_51]
	at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:407) ~[main/:na]
	... 11 common frames omitted
Caused by: java.lang.AssertionError: There shouldn't be more than one compact value defined:
got ColumnDefinition{name=qux, type=org.apache.cassandra.db.marshal.UTF8Type, kind=COMPACT_VALUE,
componentIndex=null, indexName=null, indexType=null} and ColumnDefinition{name=value, type=org.apache.cassandra.db.marshal.UTF8Type,
kind=COMPACT_VALUE, componentIndex=null, indexName=null, indexType=null}
	at org.apache.cassandra.config.CFMetaData.rebuild(CFMetaData.java:1981) ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.fromSchemaNoTriggers(CFMetaData.java:1751) ~[main/:na]
	at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1791) ~[main/:na]
	at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:320)
~[main/:na]
	at org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:306) ~[main/:na]
	at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:181) ~[main/:na]
	at org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:306)
~[main/:na]
	at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) ~[main/:na]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_51]
	at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_51]
	... 3 common frames omitted
{code}

Then I quit ``cqlsh`` and start in again, and now I have
{code:title=cqlsh after cli}
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.0 | Cassandra 2.1.0-beta1-SNAPSHOT | CQL spec 3.1.5 | Native protocol v2]
Use HELP for help.
cqlsh> use test;
cqlsh:test> DESCRIBE TABLE foo;

CREATE TABLE test.foo (
    bar text,
    column1 text,
    value text,
    baz text,
    qux text,
    PRIMARY KEY (bar, column1)
) WITH COMPACT STORAGE
    AND CLUSTERING ORDER BY (column1 ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = 'hey this is a comment'
    AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy',
'max_threshold': '32'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND populate_io_cache_on_flush = false
    AND read_repair_chance = 0.1
    AND speculative_retry = '99.0PERCENTILE';
cqlsh:test>
{code}

> Updates to COMPACT STORAGE tables via cli drop CQL information
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-6831
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6831
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Russell Bradberry
>            Priority: Minor
>
> If a COMPACT STORAGE table is altered using the CLI all information about the column
names reverts to the initial "key, column1, column2" namings.  Additionally, the changes in
the columns name will not take effect until the Cassandra service is restarted.  This means
that the clients using CQL will continue to work properly until the service is restarted,
at which time they will start getting errors about non-existant columns in the table.
> When attempting to rename the columns back using ALTER TABLE an error stating the column
already exists will be raised.  The only way to get it back is to ALTER TABLE and change the
comment or something, which will bring back all the original column names.
> This seems to be related to CASSANDRA-6676 and CASSANDRA-6370
> In cqlsh
> {code}
> Connected to cluster1 at 127.0.0.3: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 test WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor'
: 3 };
> cqlsh> USE test;
> cqlsh:test> CREATE TABLE foo (bar text, baz text, qux text, PRIMARY KEY(bar, baz)
) WITH COMPACT STORAGE;
> cqlsh:test> describe table foo;
> CREATE TABLE foo (
>   bar text,
>   baz text,
>   qux text,
>   PRIMARY KEY (bar, baz)
> ) WITH COMPACT STORAGE AND
>   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'};
> {code}
> Now in cli:
> {code}
>   Connected to: "cluster1" on 127.0.0.3/9160
> Welcome to Cassandra CLI version 1.2.15-SNAPSHOT
> Type 'help;' or '?' for help.
> Type 'quit;' or 'exit;' to quit.
> [default@unknown] use test;
> Authenticated to keyspace: test
> [default@test] UPDATE COLUMN FAMILY foo WITH comment='hey this is a comment';
> 3bf5fa49-5d03-34f0-b46c-6745f7740925
> {code}
> Now back in cqlsh:
> {code}
> cqlsh:test> describe table foo;
> CREATE TABLE foo (
>   bar text,
>   column1 text,
>   value text,
>   PRIMARY KEY (bar, column1)
> ) WITH COMPACT STORAGE AND
>   bloom_filter_fp_chance=0.010000 AND
>   caching='KEYS_ONLY' AND
>   comment='hey this is a 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:test> ALTER TABLE foo WITH comment='this is a new comment';
> cqlsh:test> describe table foo;
> CREATE TABLE foo (
>   bar text,
>   baz text,
>   qux text,
>   PRIMARY KEY (bar, baz)
> ) WITH COMPACT STORAGE AND
>   bloom_filter_fp_chance=0.010000 AND
>   caching='KEYS_ONLY' AND
>   comment='this is a new 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'};
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message