From 3e1294852691a6e6b10cfaa1e50d39e6c097718b Mon Sep 17 00:00:00 2001 From: Chris Larsen Date: Mon, 12 Dec 2016 23:14:00 -0800 Subject: [PATCH] Fix #868 by advancing the scanner end time by one second. That will force the scan to the next row and allow the serializer to filter out the unwanted results. Thanks @rcastbergw! Signed-off-by: Chris Larsen --- src/core/TsdbQuery.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/TsdbQuery.java b/src/core/TsdbQuery.java index 0b64ebe5c6..6348e0ba59 100644 --- a/src/core/TsdbQuery.java +++ b/src/core/TsdbQuery.java @@ -1063,6 +1063,11 @@ private long getScanEndTimeSeconds() { // Convert to seconds if we have a query in ms. if ((end & Const.SECOND_MASK) != 0L) { end /= 1000L; + if (end - (end * 1000) < 1) { + // handle an edge case where a user may request a ms time between + // 0 and 1 seconds. Just bump it a second. + end++; + } } // The calculation depends on whether we're downsampling.