[
https://issues.apache.org/jira/browse/CASSANDRA-2730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042349#comment-13042349
]
Cathy Daw edited comment on CASSANDRA-2730 at 6/1/11 6:47 PM:
--------------------------------------------------------------
*For clarity, this occurs only when you create the same named index referencing
different columns*
* Workaround #1: In CQLSH: Prior to restarting server, drop this column
family after you see this error, then future server restarts will be fine.
* Workaround #2: In cassandra-cli: Prior to restarting server, run the "drop
index cf column" command for both attempts (birth_year and session_token in my
example), then future server restarts will be fine.
{code}
cqlsh> CREATE INDEX birth_year_key ON users (session_token);
Bad Request: javax.management.InstanceAlreadyExistsException:
org.apache.cassandra.db:type=IndexColumnFamilies,keyspace=cqldb,columnfamily=users.birth_year_key
{code}
*PASS: CQLSH allows multiple indexes without an issue*
{code}
cqlsh> CREATE INDEX gender_key ON users (gender);
cqlsh> CREATE INDEX state_key ON users (state);
cqlsh> CREATE INDEX birth_year_key ON users (birth_year);
{code}
*PASS: CQLSH correctly errors out creating the same index twice*
{code}
cqlsh> CREATE INDEX birth_year_key ON users (birth_year);
Bad Request: Index exists
{code}
was (Author: cdaw):
*For clarity, this occurs only when you create the same named index
referencing different columns*
* Workaround #1: In CQLSH: Prior to restarting server, drop this column
family after you see this error, then future server restarts will be fine.
* Workaround #2: In cassandra-cli: Prior to restarting server, run the drop
index command for this index, then future server restarts will be fine.
{code}
cqlsh> CREATE INDEX birth_year_key ON users (session_token);
Bad Request: javax.management.InstanceAlreadyExistsException:
org.apache.cassandra.db:type=IndexColumnFamilies,keyspace=cqldb,columnfamily=users.birth_year_key
{code}
*PASS: CQLSH allows multiple indexes without an issue*
{code}
cqlsh> CREATE INDEX gender_key ON users (gender);
cqlsh> CREATE INDEX state_key ON users (state);
cqlsh> CREATE INDEX birth_year_key ON users (birth_year);
{code}
*PASS: CQLSH correctly errors out creating the same index twice*
{code}
cqlsh> CREATE INDEX birth_year_key ON users (birth_year);
Bad Request: Index exists
{code}
> exception generate when using same index names
> ----------------------------------------------
>
> Key: CASSANDRA-2730
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2730
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.8 beta 1
> Reporter: BAONING WU
> Labels: cql
>
> when using cqlsh tool to generate indexes, for example, suppose we have a
> column family Tuser, which has two columns: name and state.
> cqlsh> create index name_key on Tuser(name);
> cqlsh> create index name_key on Tuser(state);
> note that name_key is used twice by mistake, then a
> javax.management.InstanceAlreadyExistsException will be thrown and this
> exception will prevent cassandra service from starting any more.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira