fix: storage read service should not return a nil cursor (#17359) (#20941)

The storage read service would return a nil cursor if there was no data
and no shards to read from. This modifies it to return an empty cursor
instead.

(cherry picked from commit 2852bf0399)

Co-authored-by: Jonathan A. Sternberg <jonathan@influxdata.com>
pull/20951/head
Sam Arnold 2021-03-12 16:36:08 -05:00 committed by GitHub
parent df46a86326
commit 849221b709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -207,8 +207,8 @@ func (s *Store) TagKeys(ctx context.Context, req *datatypes.TagKeysRequest) (cur
if err != nil {
return nil, err
}
if len(shardIDs) == 0 { // TODO(jeff): this was a typed nil
return nil, nil
if len(shardIDs) == 0 {
return cursors.NewStringSliceIterator(nil), nil
}
var expr influxql.Expr
@ -282,8 +282,8 @@ func (s *Store) TagValues(ctx context.Context, req *datatypes.TagValuesRequest)
if err != nil {
return nil, err
}
if len(shardIDs) == 0 { // TODO(jeff): this was a typed nil
return nil, nil
if len(shardIDs) == 0 {
return cursors.NewStringSliceIterator(nil), nil
}
var expr influxql.Expr