[
https://issues.apache.org/jira/browse/CASSANDRA-8879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14347941#comment-14347941
]
Aleksey Yeschenko commented on CASSANDRA-8879:
----------------------------------------------
Okay, here is the column name serialization issue I mentioned before:
{noformat}
[default@test] create column family test with comparator = AsciiType;
[default@test] update column family test with column_metadata = [{column_name:
col, validation_class: UTF8Type}];
{noformat}
Here is what we now have in {{system.schema_columns}}:
{noformat}
cqlsh> select * from system.schema_columns where keyspace_name = 'test';
keyspace_name | columnfamily_name | column_name | component_index | index_name
| index_options | index_type | type | validator
---------------+-------------------+-------------+-----------------+------------+---------------+------------+----------------+-------------------------------------------
test | test | col | null | null
| null | null | regular |
org.apache.cassandra.db.marshal.UTF8Type
test | test | column1 | null | null
| null | null | clustering_key |
org.apache.cassandra.db.marshal.AsciiType
test | test | key | null | null
| null | null | partition_key |
org.apache.cassandra.db.marshal.BytesType
test | test | value | null | null
| null | null | compact_value |
org.apache.cassandra.db.marshal.BytesType
(4 rows)
{noformat}
So far so good. Now, let's alter {{column1}} from {{ascii}} to {{bytes}}:
{noformat}
cqlsh:test> alter table test alter column1 type blob;
TSocket read 0 bytes
{noformat}
Cassandra logs:
{noformat}
ERROR 17:48:49,355 Exception in thread Thread[MigrationStage:1,5,main]
org.apache.cassandra.serializers.MarshalException: cannot parse 'col' as hex
bytes
at
org.apache.cassandra.db.marshal.BytesType.fromString(BytesType.java:56)
at
org.apache.cassandra.config.ColumnDefinition.fromSchema(ColumnDefinition.java:323)
at
org.apache.cassandra.config.CFMetaData.addColumnDefinitionsFromSchema(CFMetaData.java:1892)
at
org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1799)
at
org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:307)
at
org.apache.cassandra.db.DefsTables.mergeColumnFamilies(DefsTables.java:259)
at org.apache.cassandra.db.DefsTables.mergeSchema(DefsTables.java:184)
at
org.apache.cassandra.service.MigrationManager$2.runMayThrow(MigrationManager.java:303)
at
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: An hex string representing bytes
must have an even length
at org.apache.cassandra.utils.Hex.hexToBytes(Hex.java:52)
at
org.apache.cassandra.db.marshal.BytesType.fromString(BytesType.java:52)
... 13 more
{noformat}
> Alter table on compact storage broken
> -------------------------------------
>
> Key: CASSANDRA-8879
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8879
> Project: Cassandra
> Issue Type: Bug
> Reporter: Nick Bailey
> Assignee: Tyler Hobbs
> Fix For: 2.0.13
>
> Attachments: 8879-2.0.txt
>
>
> In 2.0 HEAD, alter table on compact storage tables seems to be broken. With
> the following table definition, altering the column breaks cqlsh and
> generates a stack trace in the log.
> {noformat}
> CREATE TABLE settings (
> key blob,
> column1 blob,
> value blob,
> PRIMARY KEY ((key), column1)
> ) WITH COMPACT STORAGE
> {noformat}
> {noformat}
> cqlsh:OpsCenter> alter table settings ALTER column1 TYPE ascii ;
> TSocket read 0 bytes
> cqlsh:OpsCenter> DESC TABLE settings;
> {noformat}
> {noformat}
> ERROR [Thrift:7] 2015-02-26 17:20:24,640 CassandraDaemon.java (line 199)
> Exception in thread Thread[Thrift:7,5,main]
> java.lang.AssertionError
> >...at
> >org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:198)
> >...at
> >org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:79)
> >...at
> >org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:158)
> >...at
> >org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:175)
> >...at
> >org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraServer.java:1958)
> >...at
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4486)
> >...at
> >org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResult(Cassandra.java:4470)
> >...at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
> >...at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> >...at
> >org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:204)
> >...at
> >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> >...at
> >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> >...at java.lang.Thread.run(Thread.java:724)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)