Merge pull request #8764 from influxdata/dn-8638-influx_inspect
fix #8638: inspect shouldn't err on missing filepull/8752/head
commit
0da711675f
|
@ -43,6 +43,7 @@
|
||||||
- [#8699](https://github.com/influxdata/influxdb/issues/8699): Force subqueries to match the parent queries ordering.
|
- [#8699](https://github.com/influxdata/influxdb/issues/8699): Force subqueries to match the parent queries ordering.
|
||||||
- [#8755](https://github.com/influxdata/influxdb/pull/8755): Fix race condition accessing `seriesByID` map.
|
- [#8755](https://github.com/influxdata/influxdb/pull/8755): Fix race condition accessing `seriesByID` map.
|
||||||
- [#8766](https://github.com/influxdata/influxdb/pull/8766): Fix deadlock when calling `SeriesIDsAllOrByExpr`
|
- [#8766](https://github.com/influxdata/influxdb/pull/8766): Fix deadlock when calling `SeriesIDsAllOrByExpr`
|
||||||
|
- [#8638](https://github.com/influxdata/influxdb/issues/8638): Fix `influx_inspect export` so it skips missing files.
|
||||||
|
|
||||||
## v1.3.4 [unreleased]
|
## v1.3.4 [unreleased]
|
||||||
|
|
||||||
|
|
|
@ -261,6 +261,10 @@ func (cmd *Command) writeTsmFiles(w io.Writer, files []string) error {
|
||||||
func (cmd *Command) exportTSMFile(tsmFilePath string, w io.Writer) error {
|
func (cmd *Command) exportTSMFile(tsmFilePath string, w io.Writer) error {
|
||||||
f, err := os.Open(tsmFilePath)
|
f, err := os.Open(tsmFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
fmt.Fprintf(w, "skipped missing file: %s", tsmFilePath)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
@ -325,6 +329,10 @@ or manually editing the exported file.
|
||||||
func (cmd *Command) exportWALFile(walFilePath string, w io.Writer, warnDelete func()) error {
|
func (cmd *Command) exportWALFile(walFilePath string, w io.Writer, warnDelete func()) error {
|
||||||
f, err := os.Open(walFilePath)
|
f, err := os.Open(walFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
fmt.Fprintf(w, "skipped missing file: %s", walFilePath)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
|
@ -95,6 +95,12 @@ func Test_exportWALFile(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Missing .wal file should not cause a failure.
|
||||||
|
var out bytes.Buffer
|
||||||
|
if err := newCommand().exportWALFile("file-that-does-not-exist.wal", &out, func() {}); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Test_exportTSMFile(t *testing.T) {
|
func Test_exportTSMFile(t *testing.T) {
|
||||||
|
@ -128,6 +134,12 @@ func Test_exportTSMFile(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Missing .tsm file should not cause a failure.
|
||||||
|
var out bytes.Buffer
|
||||||
|
if err := newCommand().exportTSMFile("file-that-does-not-exist.tsm", &out); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var sink interface{}
|
var sink interface{}
|
||||||
|
|
Loading…
Reference in New Issue