Elasticsearch Version
8.16.0
Installed Plugins
No response
Java Version
17.0.11
OS Version
Darwin 23.5.0
Problem Description
While doing some tests with TDigest library (https://github.com/elastic/elasticsearch/tree/main/libs/tdigest) and I am getting this:
java.lang.ArrayIndexOutOfBoundsException: Index 30 out of bounds for length 30
when using low compression settings. The code:
TDigest td = TDigest.createMergingDigest(10);
for(int i=0; i<1_000_000;i++) {
td.add(between(0, 3_600_000));
}
If I use compression setting of 20, it does not happen.
Steps to Reproduce
Just running this code:
TDigest td = TDigest.createMergingDigest(10);
for(int i=0; i<1_000_000;i++) {
td.add(between(0, 3_600_000));
}
java.lang.ArrayIndexOutOfBoundsException: Index 30 out of bounds for length 30
at __randomizedtesting.SeedInfo.seed([84E0D3DB44015BF7:7ABC623A61BC3D68]:0)
at org.elasticsearch.tdigest.MergingDigest.merge(MergingDigest.java:325)
at org.elasticsearch.tdigest.MergingDigest.mergeNewValues(MergingDigest.java:247)
at org.elasticsearch.tdigest.MergingDigest.mergeNewValues(MergingDigest.java:237)
at org.elasticsearch.tdigest.MergingDigest.add(MergingDigest.java:222)
at org.elasticsearch.tdigest.TDigest.add(TDigest.java:105)
at org.elasticsearch.search.ccs.CrossClusterSearchIT.testTDigest(CrossClusterSearchIT.java:744)
(ignore the last line it's just random test to which I've attached the code to run it)
Elasticsearch Version
8.16.0
Installed Plugins
No response
Java Version
17.0.11
OS Version
Darwin 23.5.0
Problem Description
While doing some tests with TDigest library (https://github.com/elastic/elasticsearch/tree/main/libs/tdigest) and I am getting this:
when using low compression settings. The code:
If I use compression setting of 20, it does not happen.
Steps to Reproduce
Just running this code:
TDigest td = TDigest.createMergingDigest(10);
for(int i=0; i<1_000_000;i++) {
td.add(between(0, 3_600_000));
}
java.lang.ArrayIndexOutOfBoundsException: Index 30 out of bounds for length 30