Skip to content

ESQL: Fix Driver search load millis as nanos bug#143267

Merged
ivancea merged 5 commits intoelastic:mainfrom
ivancea:unmute-esql-lucene-oeprator-times
Mar 2, 2026
Merged

ESQL: Fix Driver search load millis as nanos bug#143267
ivancea merged 5 commits intoelastic:mainfrom
ivancea:unmute-esql-lucene-oeprator-times

Conversation

@ivancea
Copy link
Copy Markdown
Contributor

@ivancea ivancea commented Feb 27, 2026

Fixes #143111
Fixes #143086
Fixes #142986

Introduced in #142841

The now variable holds millis, while the reportSearchLoad() expects nanos.
Propagated nowSupplier there instead to pass the actual nanos.

@ivancea ivancea requested review from Copilot and jimczi February 27, 2026 16:31
@ivancea ivancea added >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.4.0 labels Feb 27, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug introduced in PR #142841 where milliseconds were incorrectly passed as nanoseconds to the reportSearchLoad() method. The bug caused test failures with incorrect search load measurements being off by a factor of 1,000,000.

Changes:

  • Fixed Driver.updateStatus() to pass nanoseconds (via nowSupplier.getAsLong()) instead of milliseconds to reportSearchLoad()
  • Propagated nowSupplier parameter through all updateStatus() and schedule() method calls to ensure consistent use of nanosecond timestamps
  • Increased test data size in LuceneSourceOperatorTests.testAccumulateSearchLoad() from (200, 10) to (2000, 100) to ensure reliable assertions with the corrected timing measurements
  • Unmuted three previously failing tests: LuceneTopNSourceOperatorTests.testAccumulateSearchLoad, LuceneTopNSourceOperatorScoringTests.testAccumulateSearchLoad, and implicitly fixed LuceneSourceOperatorTests.testAccumulateSearchLoad

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Driver.java Core bug fix: Added nowSupplier parameter to updateStatus() and propagated it through all calls; uses nowSupplier.getAsLong() for nanoseconds in reportSearchLoad() while keeping System.currentTimeMillis() for status timestamps
LuceneSourceOperatorTests.java Increased test data size from (200, 10) to (2000, 100) to ensure reliable test assertions with accurate timing measurements
muted-tests.yml Unmuted two TopN test variants that were failing due to the timing bug

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivancea ivancea enabled auto-merge (squash) February 27, 2026 17:05
@ivancea ivancea merged commit 3f33e5b into elastic:main Mar 2, 2026
35 checks passed
@ivancea ivancea deleted the unmute-esql-lucene-oeprator-times branch March 2, 2026 12:27
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 2, 2026
…cations

* upstream/main: (60 commits)
  Use batches for other bulk vector benchmarks (elastic#143167)
  Mute org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT test {csv-spec:lookup-join.MvJoinKeyOnTheLookupIndexAfterStats} elastic#143388
  Mute org.elasticsearch.snapshots.ConcurrentSnapshotsIT testBackToBackQueuedDeletes elastic#143387
  [Inference API] Parse endpoint metadata from persisted endpoints (elastic#143081)
  Add cluster formation doc to DistributedArchitectureGuide (elastic#143318)
  Fix flattened root block loader null expectation (elastic#143238)
  Unmute ValueSourceReaderTypeConversionTests testLoadAll (elastic#143189)
  ESQL: Add split coalescing for many small files (elastic#143335)
  Unmute mixed-cluster spatial parse warning test (elastic#143186)
  Fix zero-size estimate in BytesRefBlock null test (elastic#143258)
  Make DataType and DataFormat top-level enums (elastic#143312)
  Add support for steps to change the target index name for later steps (elastic#142955)
  Set mayContainDuplicates flag to test deduplication (elastic#143375)
  ESQL: Fix Driver search load millis as nanos bug (elastic#143267)
  Mute org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT test {csv-spec:lookup-join.LookupJoinWithMixPushableAndUnpushableFilters} elastic#143378
  ESQL: Forbid MV_EXPAND before full text functions (elastic#143249)
  ESQL: Fix unresolved name pattern (elastic#143210)
  Implement boxplot queryDSL aggregation for exponential_histograms (elastic#143026)
  Add prefetching to x64 bulk vector implementations (elastic#142387)
  Make large segment vector tests resilient to memory constraints (elastic#143366)
  ...
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
Fixes elastic#143111
Fixes elastic#143086
Fixes elastic#142986

Introduced in elastic#142841

The `now` variable holds millis, while the `reportSearchLoad()` expects nanos.
Propagated `nowSupplier` there instead to pass the actual nanos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.4.0

Projects

None yet

5 participants