Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
cassandra 1.1.2, RHEL6.3, running under java-1.6.0-sun
-
Low
Description
Using cassandra-cli the following update to a column family worked in 1.1.0:
create keyspace testing; use testing; create column family Album with comparator = UTF8Type and default_validation_class = UTF8Type and column_metadata = [ {column_name: profileId, validation_class: UTF8Type, index_type: KEYS} ]; update column family Album and column_metadata = [ {column_name: profileId, validation_class: UTF8Type, index_type: KEYS}, {column_name: postedDate, validation_class: LongType} ];
After upgrading to 1.1.2, the update statement fails with the following exception in system.log:
ERROR [Thrift:16] 2012-07-13 14:51:54,558 CustomTThreadPoolServer.java (line 204) Error occurred during processing of message.
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.io.IOException: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:373)
at org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:188)
at org.apache.cassandra.service.MigrationManager.announceColumnFamilyUpdate(MigrationManager.java:161)
at org.apache.cassandra.thrift.CassandraServer.system_update_column_family(CassandraServer.java:1063)
at org.apache.cassandra.thrift.Cassandra$Processor$system_update_column_family.getResult(Cassandra.java:3520)
at org.apache.cassandra.thrift.Cassandra$Processor$system_update_column_family.getResult(Cassandra.java:3508)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.cassandra.utils.FBUtilities.waitOnFuture(FBUtilities.java:369)
... 11 more
Caused by: java.io.IOException: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:676)
at org.apache.cassandra.db.DefsTable.updateColumnFamily(DefsTable.java:463)
at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:407)
at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:271)
at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:211)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
... 3 more
Caused by: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at org.apache.cassandra.config.ColumnDefinition.apply(ColumnDefinition.java:214)
at org.apache.cassandra.config.CFMetaData.apply(CFMetaData.java:758)
at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:672)
... 9 more
ERROR [MigrationStage:1] 2012-07-13 14:51:54,561 AbstractCassandraDaemon.java (line 134) Exception in thread Thread[MigrationStage:1,5,main]
java.io.IOException: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:676)
at org.apache.cassandra.db.DefsTable.updateColumnFamily(DefsTable.java:463)
at org.apache.cassandra.db.DefsTable.mergeColumnFamilies(DefsTable.java:407)
at org.apache.cassandra.db.DefsTable.mergeSchema(DefsTable.java:271)
at org.apache.cassandra.service.MigrationManager$1.call(MigrationManager.java:211)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.cassandra.config.ConfigurationException: Cannot modify index name
at org.apache.cassandra.config.ColumnDefinition.apply(ColumnDefinition.java:214)
at org.apache.cassandra.config.CFMetaData.apply(CFMetaData.java:758)
at org.apache.cassandra.config.CFMetaData.reload(CFMetaData.java:672)
... 9 more
After further testing the following works in 1.1.2:
create keyspace testing; use testing; create column family Album with comparator = UTF8Type and default_validation_class = UTF8Type and column_metadata = [ {column_name: profileId, validation_class: UTF8Type, index_name: 'Album_profileId_idx', index_type: KEYS} ]; update column family Album and column_metadata = [ {column_name: profileId, validation_class: UTF8Type, index_name: 'Album_profileId_idx', index_type: KEYS}, {column_name: postedDate, validation_class: LongType} ];
So it appears that if you did not specify an index_name when creating the column originally, you cannot update the column family anymore.