You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Dmitry Konstantinov (Jira)" <ji...@apache.org> on 2025/08/21 12:50:00 UTC
[jira] [Created] (CASSANDRA-20855) sstablemetadata throws IndexOutOfBoundsException if maxClustering is not a full clustering key
Dmitry Konstantinov created CASSANDRA-20855:
-----------------------------------------------
Summary: 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
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 what 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-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org