[
https://issues.apache.org/jira/browse/CASSANDRA-6831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tyler Hobbs reopened CASSANDRA-6831:
------------------------------------
Reproduced In: 2.1 beta1, 2.0.6, 1.2.16 (was: 1.2.16, 2.0.6, 2.1 beta1)
It looks like the 2.1 patch broke CF secondary index creation through Thrift.
The following error shows up when when adding a column definition with an index
on it:
{noformat}
INFO [MigrationStage:1] 2014-04-30 16:34:11,766 DefsTables.java:388 - Loading
org.apache.cassandra.config.CFMetaData@1547508d[cfId=2b5c99b0-d0af-11e3-a938-6b09a6cc3d5a,ksName=PycassaTestKeyspace,cfName=Indexed1,cfType=Standard,comparator=org.apache.cassandra.db.marshal.BytesType,comment=,readRepairChance=0.1,dclocalReadRepairChance=0.0,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.BytesType,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata={java.nio.HeapByteBuffer[pos=0
lim=3 cap=3]=ColumnDefinition{name=key,
type=org.apache.cassandra.db.marshal.BytesType, kind=PARTITION_KEY,
componentIndex=null, indexName=null, indexType=null},
java.nio.HeapByteBuffer[pos=0 lim=5 cap=5]=ColumnDefinition{name=value,
type=org.apache.cassandra.db.marshal.BytesType, kind=COMPACT_VALUE,
componentIndex=null, indexName=null, indexType=null},
java.nio.HeapByteBuffer[pos=0 lim=7 cap=7]=ColumnDefinition{name=column1,
type=org.apache.cassandra.db.marshal.BytesType, kind=CLUSTERING_COLUMN,
componentIndex=null, indexName=null,
indexType=null}},compactionStrategyClass=class
org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=<null>,memtableFlushPeriod=0,caching={"keys":"ALL",
"rows_per_partition":"NONE"},defaultTimeToLive=0,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=NONE,droppedColumns={},triggers={}]
INFO [MigrationStage:1] 2014-04-30 16:34:11,771 ColumnFamilyStore.java:285 -
Initializing PycassaTestKeyspace.Indexed1
ERROR [Thrift:1] 2014-04-30 16:34:11,810 CustomTThreadPoolServer.java:219 -
Error occurred during processing of message.
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635) ~[na:1.7.0_40]
at java.util.ArrayList.set(ArrayList.java:426) ~[na:1.7.0_40]
at org.apache.cassandra.config.CFMetaData.rebuild(CFMetaData.java:2037)
~[main/:na]
at
org.apache.cassandra.config.CFMetaData.fromThriftForUpdate(CFMetaData.java:1036)
~[main/:na]
at
org.apache.cassandra.thrift.CassandraServer.system_update_column_family(CassandraServer.java:1668)
~[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_40]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [na:1.7.0_40]
{noformat}.
> 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
> Assignee: Mikhail Stepura
> Priority: Minor
> Fix For: 1.2.17, 2.0.8, 2.1 beta2
>
> Attachments: 6831-1.2.patch, 6831-2.0-v2.txt, 6831-2.1.patch
>
>
> 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)