Skip to content

Commit

Permalink
fix: don't write skipped shard messages to the line protocol output d…
Browse files Browse the repository at this point in the history
…estination (influxdata#23727) (influxdata#23885)

This switches so that the message

    skipped missing file: /path/to/tsm.tsm

is written to stdErr instead of stdout (or the output file if `-out` has been provided)

(cherry picked from commit a9bf1d5)

closes influxdata#23866

Co-authored-by: Ben Tasker <88340935+btasker@users.noreply.github.com>
  • Loading branch information
2 people authored and chengshiwen committed Aug 27, 2024
1 parent e91ec30 commit 39c0352
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/influx_inspect/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func (cmd *Command) exportTSMFile(tsmFilePath string, w io.Writer) error {
f, err := os.Open(tsmFilePath)
if err != nil {
if os.IsNotExist(err) {
fmt.Fprintf(w, "skipped missing file: %s", tsmFilePath)
fmt.Fprintf(cmd.Stderr, "skipped missing file: %s", tsmFilePath)
return nil
}
return err
Expand Down Expand Up @@ -408,7 +408,7 @@ func (cmd *Command) exportWALFile(walFilePath string, w io.Writer, warnDelete fu
f, err := os.Open(walFilePath)
if err != nil {
if os.IsNotExist(err) {
fmt.Fprintf(w, "skipped missing file: %s", walFilePath)
fmt.Fprintf(cmd.Stderr, "skipped missing file: %s", walFilePath)
return nil
}
return err
Expand Down

0 comments on commit 39c0352

Please sign in to comment.