Skip to content

Fix HistogramUnionState.equals for empty instances#143990

Merged
JonasKunz merged 1 commit intoelastic:mainfrom
JonasKunz:fix-histgoram-union-state-tests
Mar 11, 2026
Merged

Fix HistogramUnionState.equals for empty instances#143990
JonasKunz merged 1 commit intoelastic:mainfrom
JonasKunz:fix-histgoram-union-state-tests

Conversation

@JonasKunz
Copy link
Copy Markdown
Contributor

@JonasKunz JonasKunz commented Mar 11, 2026

I was notified by @nicktindall about an apparently rare test failure related to histograms in queryDSL:

./gradlew ":server:test" --tests "org.elasticsearch.search.aggregations.metrics.TDigestPercentilesAggregatorTests.testQueryFiltering" -Dtests.seed=7EFB3BA331FB1ED1 -Dtests.locale=sbp -Dtests.timezone=Africa/Khartoum -Druntime.java=25

As it turns out, there was a bug in the HistogramUnionState class I recently introduced: For empty states, we use a singleton instance. That singleton is in fact a sub-class, preventing mutations. At the same time in equals we were checking the class identity, causing deserialzed, empty HistogramUnionStates to not be equal to that singleton.

@JonasKunz JonasKunz added >bug :StorageEngine/Mapping The storage related side of mappings labels Mar 11, 2026
@JonasKunz JonasKunz requested a review from kkrik-es March 11, 2026 08:27
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine external-contributor Pull request authored by a developer outside the Elasticsearch team labels Mar 11, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@JonasKunz JonasKunz merged commit 2e1676e into elastic:main Mar 11, 2026
36 checks passed
@JonasKunz JonasKunz deleted the fix-histgoram-union-state-tests branch March 11, 2026 16:43
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 11, 2026
…elocations

* upstream/main: (54 commits)
  [ES|QL|DS] Wire parallel parsing into production for text formats (elastic#143997)
  ESQL: Allow EXTERNAL commands be run part of the CsvTests suite (elastic#143970)
  [ESQL] Push stats to external source via metadata (elastic#143940)
  Mute org.elasticsearch.xpack.esql.CsvIT test {csv-spec:approximation.Approximate stats with stats where} elastic#144051
  Refactored SortedNumericDocValuesSyntheticFieldLoader into a Layer (elastic#143912)
  Enable extended doc_values params feature flag in RandomizedRollingUpgradeIT (elastic#143918)
  Mute org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT test {csv-spec:approximation.Approximate stats with sample} elastic#144022
  Ensure we use float values for rolling upgrade float vectors (elastic#144032)
  Remove sensitive info from reindex task description (elastic#143635)
  Fix HistogramUnionState.equals (elastic#143990)
  Use dedicated IndexRouting API in ShardSplittingQuery (elastic#143776)
  Engine/Store DistributedArchitectureGuide doc (elastic#143818)
  Mute org.elasticsearch.snapshots.ConcurrentSnapshotsIT testDeletesAreBatched elastic#144034
  Avoid serializing exceptions as JSON in remote write endpoint (elastic#143987)
  allow testLoadDocSequenceReturnsCorrectResultsText to circuit break, it happens in serverless occasionally (elastic#144023)
  [ESQL] Adds memory accounting to GroupedLimitOperator (elastic#143941)
  Adjust ESIntegTestCase.getLiveDocs method to account for pruned sequence numbers (elastic#143999)
  Support target bucket count in `TBUCKET` with explicit from/to date range (elastic#142747)
  TSDBDocValuesFormatSingleNodeTests with and without synthetic id (elastic#144002)
  Fix circuit breaker leak in BreakingTDigestHolder (elastic#143873)
  ...
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug external-contributor Pull request authored by a developer outside the Elasticsearch team :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants