Skip to content

Commit

Permalink
[query] Fix offset fetching too much data (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnikola authored Apr 9, 2020
1 parent a5a84d0 commit 882ecb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/query/plan/physical.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func (p PhysicalPlan) shiftTime() PhysicalPlan {
}

spec := boundOp.Bounds()
if spec.Offset+p.LookbackDuration > maxOffset {
maxOffset = spec.Offset + p.LookbackDuration
if p.LookbackDuration > maxOffset {
maxOffset = p.LookbackDuration
}

if spec.Range > maxRange {
Expand Down
2 changes: 1 addition & 1 deletion src/query/plan/physical_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ func TestShiftTime(t *testing.T) {
p, err = NewPhysicalPlan(lp, params)
require.NoError(t, err)
assert.Equal(t, params.Start.
Add(-1*(time.Minute+time.Hour+defaultLookbackDuration)), p.TimeSpec.Start,
Add(-1*(time.Hour+defaultLookbackDuration)), p.TimeSpec.Start,
"start time offset by fetch")
}

0 comments on commit 882ecb1

Please sign in to comment.