You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jordan West (Jira)" <ji...@apache.org> on 2020/11/05 22:32:00 UTC

[jira] [Commented] (CASSANDRA-16241) ArrayClustering does not properly handle null clustering key elements left over from tables created WITH COMPACT STORAGE

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

Jordan West commented on CASSANDRA-16241:
-----------------------------------------

+1 LGTM. Ran the test locally as well and verified it vailed without the fix. Also looked at the call-sites of {{getBufferArrray}}. 

> ArrayClustering does not properly handle null clustering key elements left over from tables created WITH COMPACT STORAGE
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16241
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16241
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Compaction
>            Reporter: Caleb Rackliffe
>            Assignee: Caleb Rackliffe
>            Priority: Normal
>              Labels: compaction
>             Fix For: 4.0-beta
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The only way we can produce null clustering key elements is leaving them empty on insert while a table is still compact. If we subsequently DROP COMPACT STORAGE, those null elements linger, and {{ArrayClustering}} does not handle them appropriately on compaction. 
> If you run the test [here|https://github.com/maedhroz/cassandra/commit/e247b7868cae383168153bbe8bbbaa47a660f76b], you should be able to observe an exception that looks roughly like this:
> {noformat}
> java.lang.NullPointerException
> 	at java.base/java.nio.ByteBuffer.wrap(ByteBuffer.java:422)
> 	at org.apache.cassandra.db.AbstractArrayClusteringPrefix.getBufferArray(AbstractArrayClusteringPrefix.java:45)
> 	at org.apache.cassandra.io.sstable.metadata.MetadataCollector.finalizeMetadata(MetadataCollector.java:246)
> 	at org.apache.cassandra.io.sstable.format.SSTableWriter.finalizeMetadata(SSTableWriter.java:315)
> 	at org.apache.cassandra.io.sstable.format.big.BigTableWriter.access$200(BigTableWriter.java:52)
> 	at org.apache.cassandra.io.sstable.format.big.BigTableWriter$TransactionalProxy.doPrepare(BigTableWriter.java:415)
> 	at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:168)
> 	at org.apache.cassandra.io.sstable.format.SSTableWriter.prepareToCommit(SSTableWriter.java:283)
> 	at org.apache.cassandra.io.sstable.SSTableRewriter.doPrepare(SSTableRewriter.java:380)
> 	at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:168)
> 	at org.apache.cassandra.db.compaction.writers.CompactionAwareWriter.doPrepare(CompactionAwareWriter.java:118)
> 	at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:168)
> 	at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.finish(Transactional.java:179)
> 	at org.apache.cassandra.db.compaction.writers.CompactionAwareWriter.finish(CompactionAwareWriter.java:128)
> 	at org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:225)
> 	at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
> {noformat}
> There are already numerous places where we respect the fact that clustering elements may be null, so this should be pretty straightforward to fix, and the tests that accompany it will probably be more complex than the fix itself.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org