You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2012/04/26 12:37:17 UTC
[jira] [Created] (CASSANDRA-4192) CQL3: fix index dropping and
assign default name if none provided at index creation
Sylvain Lebresne created CASSANDRA-4192:
-------------------------------------------
Summary: CQL3: fix index dropping and assign default name if none provided at index creation
Key: CASSANDRA-4192
URL: https://issues.apache.org/jira/browse/CASSANDRA-4192
Project: Cassandra
Issue Type: Bug
Components: API
Affects Versions: 1.1.0
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Fix For: 1.1.1
This ticket proposes to fix two problems of CQL3 index handling:
# DROP INDEX is broken (because the code forgot to clone the metadata before doing modification which break the schema update path)
# If an index is created with a name (which CREATE INDEX allow), there is no way to drop the index (note that we will internally assign a name to the index ColumnFamilyStore, but we don't assign a name in the ColumnDefinition object, which is the only one checked by DROP INDEX).
--
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
[jira] [Commented] (CASSANDRA-4192) CQL3: fix index dropping and
assign default name if none provided at index creation
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13266748#comment-13266748 ]
Jonathan Ellis commented on CASSANDRA-4192:
-------------------------------------------
Can we leverage CFMetadata.validate instead of rewriting the code here?
> CQL3: fix index dropping and assign default name if none provided at index creation
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-4192
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4192
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 1.1.0
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Labels: cql3
> Fix For: 1.1.1
>
> Attachments: 4192.txt
>
>
> This ticket proposes to fix two problems of CQL3 index handling:
> # DROP INDEX is broken (because the code forgot to clone the metadata before doing modification which break the schema update path)
> # If an index is created with a name (which CREATE INDEX allow), there is no way to drop the index (note that we will internally assign a name to the index ColumnFamilyStore, but we don't assign a name in the ColumnDefinition object, which is the only one checked by DROP INDEX).
--
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
[jira] [Updated] (CASSANDRA-4192) CQL3: fix index dropping and
assign default name if none provided at index creation
Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sylvain Lebresne updated CASSANDRA-4192:
----------------------------------------
Attachment: 4192-v2.txt
Right, I looked too quickly at that code and missed that we already validate the name is not unique and we already do assign a name to index that don't have one, sorry. What we could do though is to make sure we pick a name that is unique when choosing a default one (it's not a big deal to fail in that case, the user can always pick a name itself, but it's not very nice).
Anyway, attaching v2, that only includes the fix to DROP INDEX and make sure we pick a unique name.
> CQL3: fix index dropping and assign default name if none provided at index creation
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-4192
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4192
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 1.1.0
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Labels: cql3
> Fix For: 1.1.1
>
> Attachments: 4192-v2.txt, 4192.txt
>
>
> This ticket proposes to fix two problems of CQL3 index handling:
> # DROP INDEX is broken (because the code forgot to clone the metadata before doing modification which break the schema update path)
> # If an index is created with a name (which CREATE INDEX allow), there is no way to drop the index (note that we will internally assign a name to the index ColumnFamilyStore, but we don't assign a name in the ColumnDefinition object, which is the only one checked by DROP INDEX).
--
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
[jira] [Commented] (CASSANDRA-4192) CQL3: fix index dropping and
assign default name if none provided at index creation
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273693#comment-13273693 ]
Jonathan Ellis commented on CASSANDRA-4192:
-------------------------------------------
+1
> CQL3: fix index dropping and assign default name if none provided at index creation
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-4192
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4192
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 1.1.0
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Labels: cql3
> Fix For: 1.1.1
>
> Attachments: 4192-v2.txt, 4192.txt
>
>
> This ticket proposes to fix two problems of CQL3 index handling:
> # DROP INDEX is broken (because the code forgot to clone the metadata before doing modification which break the schema update path)
> # If an index is created with a name (which CREATE INDEX allow), there is no way to drop the index (note that we will internally assign a name to the index ColumnFamilyStore, but we don't assign a name in the ColumnDefinition object, which is the only one checked by DROP INDEX).
--
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
[jira] [Updated] (CASSANDRA-4192) CQL3: fix index dropping and
assign default name if none provided at index creation
Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sylvain Lebresne updated CASSANDRA-4192:
----------------------------------------
Attachment: 4192.txt
Patch attached fixes the two issues above. For the second one, it makes sure CREATE INDEX always assign a name to the index. If none is provided, it assign a default one based on the column family name and column name (making sure that 1) the index name is valid and 2) the name is unique). The patch also make sure one cannot create 2 index with the same name, as DROP would have a random behavior in that case.
Note that is probably other way to deal with those problems, yet I'm not sure it's worth getting much more fancy than that.
> CQL3: fix index dropping and assign default name if none provided at index creation
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-4192
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4192
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 1.1.0
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Labels: cql3
> Fix For: 1.1.1
>
> Attachments: 4192.txt
>
>
> This ticket proposes to fix two problems of CQL3 index handling:
> # DROP INDEX is broken (because the code forgot to clone the metadata before doing modification which break the schema update path)
> # If an index is created with a name (which CREATE INDEX allow), there is no way to drop the index (note that we will internally assign a name to the index ColumnFamilyStore, but we don't assign a name in the ColumnDefinition object, which is the only one checked by DROP INDEX).
--
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