cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Ramirez (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11443) Prevent (or warn) changing clustering order with ALTER TABLE when data already exists
Date Sat, 02 Apr 2016 07:06:25 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-11443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15222759#comment-15222759
] 

Erick Ramirez commented on CASSANDRA-11443:
-------------------------------------------

I am just a little overloaded at the moment but I will write up a test for this. I believe
it's a simple case of:
- create a table with a clustering column
- insert data and flush to disk
- alter the table to change the clustering order
- insert data and flush to disk
- force compaction

> Prevent (or warn) changing clustering order with ALTER TABLE when data already exists
> -------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11443
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11443
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Compaction, CQL
>            Reporter: Erick Ramirez
>             Fix For: 2.1.x, 2.2.x, 3.0.x
>
>
> Inexperienced DBAs get caught out on certain schema changes thinking that Cassandra will
automatically retrofit/convert the existing data on disk.
> We should prevent users from changing the clustering order on existing tables or they
will run into compaction/read issues such as (example from Cassandra 2.0.14):
> {noformat}
> ERROR [CompactionExecutor:6488] 2015-07-14 19:33:14,247 CassandraDaemon.java (line 258)
Exception in thread Thread[CompactionExecutor:6488,1,main] 
> java.lang.AssertionError: Added column does not sort as the last column 
> at org.apache.cassandra.db.ArrayBackedSortedColumns.addColumn(ArrayBackedSortedColumns.java:116)

> at org.apache.cassandra.db.ColumnFamily.addColumn(ColumnFamily.java:121) 
> at org.apache.cassandra.db.ColumnFamily.addAtom(ColumnFamily.java:155) 
> at org.apache.cassandra.io.sstable.SSTableIdentityIterator.getColumnFamilyWithColumns(SSTableIdentityIterator.java:186)

> at org.apache.cassandra.db.compaction.PrecompactedRow.merge(PrecompactedRow.java:98)

> at org.apache.cassandra.db.compaction.PrecompactedRow.<init>(PrecompactedRow.java:85)

> at org.apache.cassandra.db.compaction.CompactionController.getCompactedRow(CompactionController.java:196)

> at org.apache.cassandra.db.compaction.CompactionIterable$Reducer.getReduced(CompactionIterable.java:74)

> at org.apache.cassandra.db.compaction.CompactionIterable$Reducer.getReduced(CompactionIterable.java:55)

> at org.apache.cassandra.utils.MergeIterator$ManyToOne.consume(MergeIterator.java:115)

> at org.apache.cassandra.utils.MergeIterator$ManyToOne.computeNext(MergeIterator.java:98)

> at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)

> at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) 
> at org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:164)

> at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) 
> at org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:60)

> at org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:59)

> at org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionTask.run(CompactionManager.java:198)

> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> At the very least, we should report a warning advising users about possible problems
when changing the clustering order if the table is not empty.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message