From 77d1a4180b09f83138c59ca5ae9294ee771e1d86 Mon Sep 17 00:00:00 2001 From: "Yiqun (Ethan) Zhang" Date: Thu, 27 Aug 2020 21:02:50 -0500 Subject: [PATCH] fix(storage): ArrayFilterCursor truncation for multi-block data (#19439) Backport https://github.com/influxdata/influxdb/commit/abfe5a54a0b419d0231762574229caddf971bbfd --- storage/reads/array_cursor.gen.go | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/storage/reads/array_cursor.gen.go b/storage/reads/array_cursor.gen.go index d798db93dd5..68a2a9061b5 100644 --- a/storage/reads/array_cursor.gen.go +++ b/storage/reads/array_cursor.gen.go @@ -55,8 +55,6 @@ func (c *floatArrayFilterCursor) Next() *cursors.FloatArray { if c.tmp.Len() > 0 { a = c.tmp - c.tmp.Timestamps = nil - c.tmp.Values = nil } else { a = c.FloatArrayCursor.Next() } @@ -76,6 +74,10 @@ LOOP: } } } + // Clear buffered timestamps & values if we make it through a cursor. + // The break above will skip this if a cursor is partially read. + c.tmp.Timestamps = nil + c.tmp.Values = nil a = c.FloatArrayCursor.Next() } @@ -284,8 +286,6 @@ func (c *integerArrayFilterCursor) Next() *cursors.IntegerArray { if c.tmp.Len() > 0 { a = c.tmp - c.tmp.Timestamps = nil - c.tmp.Values = nil } else { a = c.IntegerArrayCursor.Next() } @@ -305,6 +305,10 @@ LOOP: } } } + // Clear buffered timestamps & values if we make it through a cursor. + // The break above will skip this if a cursor is partially read. + c.tmp.Timestamps = nil + c.tmp.Values = nil a = c.IntegerArrayCursor.Next() } @@ -513,8 +517,6 @@ func (c *unsignedArrayFilterCursor) Next() *cursors.UnsignedArray { if c.tmp.Len() > 0 { a = c.tmp - c.tmp.Timestamps = nil - c.tmp.Values = nil } else { a = c.UnsignedArrayCursor.Next() } @@ -534,6 +536,10 @@ LOOP: } } } + // Clear buffered timestamps & values if we make it through a cursor. + // The break above will skip this if a cursor is partially read. + c.tmp.Timestamps = nil + c.tmp.Values = nil a = c.UnsignedArrayCursor.Next() } @@ -742,8 +748,6 @@ func (c *stringArrayFilterCursor) Next() *cursors.StringArray { if c.tmp.Len() > 0 { a = c.tmp - c.tmp.Timestamps = nil - c.tmp.Values = nil } else { a = c.StringArrayCursor.Next() } @@ -763,6 +767,10 @@ LOOP: } } } + // Clear buffered timestamps & values if we make it through a cursor. + // The break above will skip this if a cursor is partially read. + c.tmp.Timestamps = nil + c.tmp.Values = nil a = c.StringArrayCursor.Next() } @@ -931,8 +939,6 @@ func (c *booleanArrayFilterCursor) Next() *cursors.BooleanArray { if c.tmp.Len() > 0 { a = c.tmp - c.tmp.Timestamps = nil - c.tmp.Values = nil } else { a = c.BooleanArrayCursor.Next() } @@ -952,6 +958,10 @@ LOOP: } } } + // Clear buffered timestamps & values if we make it through a cursor. + // The break above will skip this if a cursor is partially read. + c.tmp.Timestamps = nil + c.tmp.Values = nil a = c.BooleanArrayCursor.Next() }