This is an automated email from the ASF dual-hosted git repository.

akshat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 0aedeb9cd46 Don't include loadTime in LoadSegmentsResult when not 
loading. (#19149)
0aedeb9cd46 is described below

commit 0aedeb9cd4630ef76d9be26439a902b5bf1502d6
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Mar 13 05:35:49 2026 -0700

    Don't include loadTime in LoadSegmentsResult when not loading. (#19149)
    
    There is a check in QueryVirtualStorageTest.assertQueryMetrics that
    verifies query/load/batch/time is zero when query/load/count is zero,
    and it sometimes flakes. This patch should hopefully fix the flakes.
---
 server/src/main/java/org/apache/druid/server/ServerManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/druid/server/ServerManager.java 
b/server/src/main/java/org/apache/druid/server/ServerManager.java
index b4a37dbeeed..d8daf88cd34 100644
--- a/server/src/main/java/org/apache/druid/server/ServerManager.java
+++ b/server/src/main/java/org/apache/druid/server/ServerManager.java
@@ -432,8 +432,8 @@ public class ServerManager implements QuerySegmentWalker
       }
       throw CloseableUtils.closeInCatch(toThrow, safetyNet);
     }
-    final long loadTime = System.nanoTime() - startLoadTime;
     final long count = actions.size();
+    final long loadTime = count == 0 ? 0 : System.nanoTime() - startLoadTime;
     return new LoadSegmentsResult(
         segmentReferences,
         loadTime,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to