Skip to content

Commit

Permalink
fix: remove nil tags check
Browse files Browse the repository at this point in the history
A key with no tags is valid, so we should not check for BOTH nil key and tags as a key could be nil, which is invalid, yet still have tags and therefore cause the check to pass which we do not want
  • Loading branch information
jdockerty committed Jan 17, 2024
1 parent 0498a9c commit 52b83b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/influx_inspect/dumptsi/dumptsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (cmd *Command) printSeries(sfile *tsdb.SeriesFile) error {
break
}
name, tags := tsdb.ParseSeriesKey(sfile.SeriesKey(e.SeriesID))
if name == nil && tags == nil {
if name == nil {
continue
}

Expand Down Expand Up @@ -371,7 +371,7 @@ func (cmd *Command) printTagValueSeries(sfile *tsdb.SeriesFile, fs *tsi1.FileSet
}

name, tags := tsdb.ParseSeriesKey(sfile.SeriesKey(e.SeriesID))
if name == nil && tags == nil {
if name == nil {
continue
}

Expand Down
8 changes: 4 additions & 4 deletions tsdb/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (itr *seriesIteratorAdapter) Next() (SeriesElem, error) {
}

name, tags := ParseSeriesKey(key)
if name == nil && tags == nil {
if name == nil {
continue
}
deleted := itr.sfile.IsDeleted(elem.SeriesID)
Expand Down Expand Up @@ -384,7 +384,7 @@ func (itr *seriesQueryAdapterIterator) Next() (*query.FloatPoint, error) {

// Convert to a key.
name, tags := ParseSeriesKey(seriesKey)
if name == nil && tags == nil {
if name == nil {
continue
}
key := string(models.MakeKey(name, tags))
Expand Down Expand Up @@ -873,7 +873,7 @@ func (itr *seriesPointIterator) Next() (*query.FloatPoint, error) {
}

name, tags := ParseSeriesKey(itr.keys[0])
if name == nil && tags == nil {
if name == nil {
continue
}
itr.keys = itr.keys[1:]
Expand Down Expand Up @@ -2349,7 +2349,7 @@ func (itr *measurementSeriesKeyByExprIterator) Next() ([]byte, error) {
}

name, tags := ParseSeriesKey(seriesKey)
if name == nil && tags == nil {
if name == nil {
continue
}

Expand Down

0 comments on commit 52b83b9

Please sign in to comment.