[ https://issues.apache.org/jira/browse/CASSANDRA-20855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18015425#comment-18015425 ]
Dmitry Konstantinov edited comment on CASSANDRA-20855 at 8/21/25 12:53 PM: --------------------------------------------------------------------------- Need to check but I suppose it is only 4.x issue because since 5.0 we have another logic in this area, introduced in CASSANDRA-17056 was (Author: dnk): Need to check but I suppose it is only 4.x issue because since 5.0 we have another logic in this area: CASSANDRA-17056 > 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 > Priority: Normal > > 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 > minClusteringValues is always the same as for maxClusteringValues 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