cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-5489) Fix 2.0 key and column aliases serialization and cqlsh DESC SCHEMA
Date Tue, 23 Apr 2013 14:35:17 GMT


Sylvain Lebresne commented on CASSANDRA-5489:

Unfortunately, this is more complicated. The fact that 1.2 doesn't handles nulls happens to
be kind of a bug.
More precisely, if using the CLI you do:
[default@ks] create column family test with comparator='CompositeType(Int32Type, Int32Type,
Int32Type)' and key_validation_class=UTF8Type and default_validation_class=UTF8Type;
and then with cqlsh:
cqlsh:ks> DESC COLUMNFAMILY test;

  key text,
  column1 int,
  column2 int,
  column3 int,
  value text,
  PRIMARY KEY (key, column1, column2, column3)
cqlsh:ks> ALTER TABLE test RENAME column2 TO foo;
TSocket read 0 bytes

Basically, the idea is that when upgrading from thrift, if you only rename some of the PK
columns, then you can have nulls in the column_alias list. At least that was the initial intention,
but well, that's not handled correctly in 1.2.

So, this is getting a bit too complicated, so what I suggest here is to simply refuse the
ALTER command above. I.e. if you're upgrading from thrift, i.e. if you don't have any column_aliases,
then we should probably only allow to rename all the cluster_alias in one shot, not one alias
by one alias. This is not really much of a restriction and that'll avoids having to handle
nulls in the key/column_aliases. 
> Fix 2.0 key and column aliases serialization and cqlsh DESC SCHEMA
> ------------------------------------------------------------------
>                 Key: CASSANDRA-5489
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core, Tools
>    Affects Versions: 2.0
>            Reporter: Aleksey Yeschenko
>            Assignee: Aleksey Yeschenko
>            Priority: Minor
>             Fix For: 2.0
>         Attachments: 5489.txt
> CASSANDRA-5125 made a slight change to how key_aliases and column_aliases are serialized
in schema. Prior to that we never kept nulls in the the json pseudo-lists. This does break
cqlsh and probably breaks 1.2 nodes receiving such migrations as well. The patch reverts this
behavior and also slightly modifies cqlsh itself to ignore non-regular columns from system.schema_columns
> This patch breaks nothing, since 2.0 already handles 1.2 non-null padded alias lists.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message