cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Schultz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-4439) Updating column family using cassandra-cli results in "Cannot modify index name"
Date Mon, 16 Jul 2012 12:58:35 GMT

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

Alex Schultz commented on CASSANDRA-4439:
-----------------------------------------

For some extra information I modified ./src/java/org/apache/cassandra/config/ColumnDefinition.java:214
to show me what the index name issue was and it appears if you don't specify the index on
the update, the index is automatically created at "Album_profileId_idx_2".  

{quote}
ERROR [Thrift:1] 2012-07-16 05:50:11,566 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 Album_profileId_idx
!= Album_profileId_idx_2
        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 Album_profileId_idx != Album_profileId_idx_2
        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 Album_profileId_idx != Album_profileId_idx_2
        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 Album_profileId_idx
!= Album_profileId_idx_2
        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-16 05:50:11,570 AbstractCassandraDaemon.java (line 134) Exception
in thread Thread[MigrationStage:1,5,main]
java.io.IOException: org.apache.cassandra.config.ConfigurationException: Cannot modify index
name Album_profileId_idx != Album_profileId_idx_2
        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 Album_profileId_idx
!= Album_profileId_idx_2
        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
{quote}


I was able to work around the issue if I specify the auto-generated index name in the update
statement.
{code}
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_name: 'Album_profileId_idx',
index_type: KEYS},
    {column_name: postedDate, validation_class: LongType}
];
{code}

Also for anyone wondering, you can find the auto-generated index name by doing a show schema
on the keyspace.  I'm going to drop the severity since I can work around the issue by adjusting
my update statements.
                
> Updating column family using cassandra-cli results in "Cannot modify index name"
> --------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-4439
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4439
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.2
>         Environment: cassandra 1.1.2, RHEL6.3, running under java-1.6.0-sun
>            Reporter: Alex Schultz
>
> Using cassandra-cli the following update to a column family worked in 1.1.0:
> {code}
> 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}
> ];
> {code}
> After upgrading to 1.1.2, the update statement fails with the following exception in
system.log:
> {quote}
> 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
> {quote}
> After further testing the following works in 1.1.2:
> {code}
> 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}
> ];
> {code}
> So it appears that if you did not specify an index_name when creating the column originally,
you cannot update the column family anymore.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message