[jira] [Updated] (CASSANDRA-4093) schema_* CFs do not respect column comparator which leads to CLI commands failure.
[ https://issues.apache.org/jira/browse/CASSANDRA-4093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-4093: Attachment: 4093_v2.txt Attaching 4093_v2. Internally, this is roughtly the same as the previous patch (using componentIndex). However, this patch doesn't not expose it through thrift and remove column_aliases and value_alias (from thrift) too. Note that it completely skip ColumnDefinition whose componentIndex is not null (i.e those created by CQL3) when translating to thrift, which fixes the CLI problem (basically the CLI don't get back the parts he don't know how to interpret). An additional change is that CFMetaData.apply() make sure that a thrift update won't wrongfully remove CQL3 only metadata (ie. columnAliases, valueAliases and ColumnDefinition with a non-null componentIndex). In other words, it's safe to create a column family through CQL3 and later update it with the cli (to avoid foot shooting for those that would be in the middle of transitioning to CQL3 for instance). The only small detail is that we *need* to backport CASSANDRA-4037 to 1.1.0 for this to work (since currently CQL do a toThrift(fromThrift()) dance for schema update (in order to use ThriftValidation)). bq. Yes, I suppose there's no reason not to expose that to Thrift as well. I'm actually happy with the idea of v2 of not exposing to thrift what's not usefull right now. I guess we can go with v2 and expose componentIndex later when it makes sense on the thrift. schema_* CFs do not respect column comparator which leads to CLI commands failure. -- Key: CASSANDRA-4093 URL: https://issues.apache.org/jira/browse/CASSANDRA-4093 Project: Cassandra Issue Type: Bug Components: Tools Affects Versions: 1.1.0 Reporter: Dave Brosius Assignee: Sylvain Lebresne Fix For: 1.1.0 Attachments: 4093.txt, 4093_v2.txt, CASSANDRA-4093-CD-changes.patch ColumnDefinition.{ascii, utf8, bool, ...} static methods used to initialize schema_* CFs column_metadata do not respect CF comparator and use ByteBufferUtil.bytes(...) for column names which creates problems in CLI and probably in other places. The CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) -- 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-4093) schema_* CFs do not respect column comparator which leads to CLI commands failure.
[ https://issues.apache.org/jira/browse/CASSANDRA-4093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-4093: Attachment: 4093.txt So the problem is the following: for CQL3, we've introduced the fact that when we have a composite comparator, the 'name' of a ColumnDefinition refers to the last component of the composite comparator. In other words, one should use the last comparator of the composite comparator to parse the ColumnDefinition name, but the CLI doesn't know that. So we do need to fix the CLI. However, now that I think about this, I realize we may have been a little bit careless when doing that, because the current code basically *assumes* that if you have a composite comparator, then ColumnDefinition refers to the last component of those. That may break compatibility for user using composite type today. I'm not sure how many people use composite comparators *and* have ColumnDefinition on them, but we probably shouldn't assume nobody does that. So I think to fix that we need to add a new information to ColumnDefinition, which if the comparator of the CF is a composite type, to which component the definition apply (or if it apply to the column name as a whole). Attached a patch that does just that. I'll note that while we could probably do with a boolean in that case (since currently we only have 2 cases: either the definition apply to the full column name or it applies to the last component), but the full generality of specifying which component exactly the definition apply to will likely be useful if we allow defining secondary index of other parts of the composite (CASSANDRA-3680). Note that the patch does fix the CLI following that change. schema_* CFs do not respect column comparator which leads to CLI commands failure. -- Key: CASSANDRA-4093 URL: https://issues.apache.org/jira/browse/CASSANDRA-4093 Project: Cassandra Issue Type: Bug Components: Tools Affects Versions: 1.1.0 Reporter: Dave Brosius Assignee: Sylvain Lebresne Fix For: 1.1.0 Attachments: 4093.txt, CASSANDRA-4093-CD-changes.patch ColumnDefinition.{ascii, utf8, bool, ...} static methods used to initialize schema_* CFs column_metadata do not respect CF comparator and use ByteBufferUtil.bytes(...) for column names which creates problems in CLI and probably in other places. The CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) -- 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-4093) schema_* CFs do not respect column comparator which leads to CLI commands failure.
[ https://issues.apache.org/jira/browse/CASSANDRA-4093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel Yaskevich updated CASSANDRA-4093: --- Reviewer: xedin Description: ColumnDefinition.{ascii, utf8, bool, ...} static methods used to initialize schema_* CFs column_metadata do not respect CF comparator and use ByteBufferUtil.bytes(...) for column names which creates problems in CLI and probably in other places. The CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) was: the CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) Priority: Major (was: Trivial) Affects Version/s: 1.1.0 Fix Version/s: 1.1.0 Assignee: Sylvain Lebresne (was: Pavel Yaskevich) Summary: schema_* CFs do not respect column comparator which leads to CLI commands failure. (was: cli - show keyspaces throws exception (and swallows) on column family schema_columnfamilies) schema_* CFs do not respect column comparator which leads to CLI commands failure. -- Key: CASSANDRA-4093 URL: https://issues.apache.org/jira/browse/CASSANDRA-4093 Project: Cassandra Issue Type: Bug Components: Tools Affects Versions: 1.1.0 Reporter: Dave Brosius Assignee: Sylvain Lebresne Fix For: 1.1.0 ColumnDefinition.{ascii, utf8, bool, ...} static methods used to initialize schema_* CFs column_metadata do not respect CF comparator and use ByteBufferUtil.bytes(...) for column names which creates problems in CLI and probably in other places. The CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) -- 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-4093) schema_* CFs do not respect column comparator which leads to CLI commands failure.
[ https://issues.apache.org/jira/browse/CASSANDRA-4093?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel Yaskevich updated CASSANDRA-4093: --- Attachment: CASSANDRA-4093-CD-changes.patch patch makes changes to ColumnDefinition to make it CF comparator aware, CLI `show` and `describe` commands works just as expected but it breaks ColumnFamily related migrations with some weird NPE exceptions. schema_* CFs do not respect column comparator which leads to CLI commands failure. -- Key: CASSANDRA-4093 URL: https://issues.apache.org/jira/browse/CASSANDRA-4093 Project: Cassandra Issue Type: Bug Components: Tools Affects Versions: 1.1.0 Reporter: Dave Brosius Assignee: Sylvain Lebresne Fix For: 1.1.0 Attachments: CASSANDRA-4093-CD-changes.patch ColumnDefinition.{ascii, utf8, bool, ...} static methods used to initialize schema_* CFs column_metadata do not respect CF comparator and use ByteBufferUtil.bytes(...) for column names which creates problems in CLI and probably in other places. The CompositeType validator throws exception on first column String columnName = columnNameValidator.getString(columnDef.name); Because it appears the composite type length header is wrong (25455) AbstractCompositeType.getWithShortLength java.lang.IllegalArgumentException at java.nio.Buffer.limit(Buffer.java:247) at org.apache.cassandra.db.marshal.AbstractCompositeType.getBytes(AbstractCompositeType.java:50) at org.apache.cassandra.db.marshal.AbstractCompositeType.getWithShortLength(AbstractCompositeType.java:59) at org.apache.cassandra.db.marshal.AbstractCompositeType.getString(AbstractCompositeType.java:139) at org.apache.cassandra.cli.CliClient.describeColumnFamily(CliClient.java:2046) at org.apache.cassandra.cli.CliClient.describeKeySpace(CliClient.java:1969) at org.apache.cassandra.cli.CliClient.executeShowKeySpaces(CliClient.java:1574) (seen in trunk) -- 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