From ee73969bbbb75244a2d7289519877ed5462632ec Mon Sep 17 00:00:00 2001 From: Luigi Dell'Aquila Date: Tue, 1 Oct 2024 17:41:05 +0200 Subject: [PATCH] ES|QL: pin 'now' as query start time (#113777) --- .../org/elasticsearch/xpack/esql/session/Configuration.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java index 0687788ad53fd..b904f07bcb9c3 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java @@ -171,11 +171,9 @@ public String query() { /** * Returns the current time in milliseconds from the time epoch for the execution of this request. * It ensures consistency by using the same value on all nodes involved in the search request. - * Note: Currently, it returns {@link System#currentTimeMillis()}, but this value will be serialized between nodes. */ public long absoluteStartedTimeInMillis() { - // MP TODO: I'm confused - Why is this not a fixed value taken at the start of the query processing? - return System.currentTimeMillis(); + return now.toInstant().toEpochMilli(); } /**