Skip to content

Commit

Permalink
fix: remove breaking argument validation for _fieldKeys iterator (#23875
Browse files Browse the repository at this point in the history
)

New argument validation code for _fieldKeys system iterator 
broke Enterprise tests because it is misused all over the 
place. Back out the safety check.
  • Loading branch information
davidby-influx committed Nov 9, 2022
1 parent f5da0f5 commit cc26b76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
5 changes: 2 additions & 3 deletions cmd/influx_tools/export/command.go
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/influxdata/influxdb/cmd/influx_tools/internal/format/line"
"github.com/influxdata/influxdb/cmd/influx_tools/internal/format/text"
"github.com/influxdata/influxdb/cmd/influx_tools/server"
errors2 "github.com/influxdata/influxdb/pkg/errors"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -105,9 +106,7 @@ func (cmd *Command) Run(args []string) (err error) {
case "discard":
wr = format.Discard
}
defer func() {
err = wr.Close()
}()
defer errors2.Capture(&err, wr.Close)()

if cmd.conflicts != nil {
wr = format.NewConflictWriter(wr, line.NewWriter(cmd.conflicts))
Expand Down
11 changes: 0 additions & 11 deletions tsdb/shard.go
Expand Up @@ -2316,17 +2316,6 @@ const (
// NewFieldKeysIterator returns an iterator that can be iterated over to
// retrieve field keys.
func NewFieldKeysIterator(sh *Shard, opt query.IteratorOptions) (query.Iterator, error) {
const fieldKey = `fieldKey`
const fieldKeyType = `fieldType`
if len(opt.Aux) != 2 {
return nil, fmt.Errorf("wrong number of field arguments for Field Keys iterator. Expected 2, got %d", len(opt.Aux))
}
if opt.Aux[0].Val != fieldKey || opt.Aux[1].Val != fieldKeyType {
return nil,
fmt.Errorf("incorrect fields specified for Field Keys iterator: expected %s, got %s and expected %s, got %s",
fieldKey, opt.Aux[0].Val, fieldKeyType, opt.Aux[1].Val)
}

itr := &fieldKeysIterator{shard: sh}

index, err := sh.Index()
Expand Down

0 comments on commit cc26b76

Please sign in to comment.