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

Stefan Miklosovic edited comment on CASSANDRA-20855 at 8/27/25 7:11 AM:
------------------------------------------------------------------------

nice! we need CI though. One detail - could you please name 
"data/sstable_metadata/test_table" like 
"data/sstable_metadata/test_table-CASSANDRA-20855" instead? Or something 
similar. It is a little bit tricky to know very quickly what test that SSTable 
belongs to, without looking into git blame or similar. 

For example here (1) is a directory called "CASSANDRA-15131" so I guess we 
could use "test/data/CASSANDRA-20855"

https://github.com/apache/cassandra/tree/cassandra-4.0/test/data


was (Author: smiklosovic):
nice! we need CI though. One detail - could you please name 
"data/sstable_metadata/test_table" like 
"data/sstable_metadata/test_table-CASSANDRA-20855" instead? Or something 
similar. It is a little bit tricky to know very quickly what test that SSTable 
belongs to, without looking into git blame or similar. 

> sstablemetadata throws IndexOutOfBoundsException if maxClustering is not a 
> full clustering key
> ----------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-20855
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20855
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Tool/sstable
>            Reporter: Dmitry Konstantinov
>            Assignee: Dmitry Konstantinov
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In some cases we may get IndexOutOfBoundsException:
> {code}
> ./tools/bin/sstablemetadata 
> /cassandra/data/keyspace/table-1707f6907c6e11f0b1fabf128b8d57a9/nb-5-big-Data.db
>  
> SSTable: 
> /cassandra/data/keyspace/table-1707f6907c6e11f0b1fabf128b8d57a9/nb-5-big
> Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
> Bloom Filter FP chance: 0.1
> Minimum timestamp: 1755556756403000 (08/18/2025 18:39:16)
> Maximum timestamp: 1755776375237088 (08/21/2025 07:39:35)
> SSTable min local deletion time: 1755774034 (08/21/2025 07:00:34)
> SSTable max local deletion time: 2147483647 (no tombstones)
> Compressor: org.apache.cassandra.io.compress.LZ4Compressor
> Compression ratio: 0.3084167695600824
> TTL min: 0
> TTL max: 5263998 (60 days 22 hours 13 minutes 18 seconds)
> First token: -9218140013640741760 (1:5129229)
> Last token: 9191231194481845151 (1:971548616326)
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, 
> Size: 1
>       at java.util.ArrayList.rangeCheck(ArrayList.java:659)
>       at java.util.ArrayList.get(ArrayList.java:435)
>       at 
> org.apache.cassandra.tools.SSTableMetadataViewer.printSStableMetadata(SSTableMetadataViewer.java:369)
>       at 
> org.apache.cassandra.tools.SSTableMetadataViewer.main(SSTableMetadataViewer.java:548)
> {code}
> In this logic we have an implicit assumption that number of values in 
> maxClusteringValues is always the same as for minClusteringValues but it is 
> not true. For example, when we have a range tombstone:
> {code}
> List<AbstractType<?>> clusteringTypes = header.getClusteringTypes();
> List<ByteBuffer> minClusteringValues = stats.minClusteringValues;
> List<ByteBuffer> maxClusteringValues = stats.maxClusteringValues;
> String[] minValues = new String[clusteringTypes.size()];
> String[] maxValues = new String[clusteringTypes.size()];
> for (int i = 0; i < clusteringTypes.size(); i++)
> {
>     minValues[i] = 
> clusteringTypes.get(i).getString(minClusteringValues.get(i));
>     maxValues[i] = 
> clusteringTypes.get(i).getString(maxClusteringValues.get(i)); // issue is 
> here <==========
> }
> field("minClusteringValues", Arrays.toString(minValues));
> field("maxClusteringValues", Arrays.toString(maxValues)); 
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to