mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
force persisting the tombstone file (#578)
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
This commit is contained in:
parent
520b1d858f
commit
8b33ee9e2b
|
@ -24,6 +24,7 @@ import (
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/prometheus/tsdb/encoding"
|
"github.com/prometheus/tsdb/encoding"
|
||||||
|
tsdb_errors "github.com/prometheus/tsdb/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
const tombstoneFilename = "tombstones"
|
const tombstoneFilename = "tombstones"
|
||||||
|
@ -100,6 +101,12 @@ func writeTombstoneFile(dir string, tr TombstoneReader) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var merr tsdb_errors.MultiError
|
||||||
|
if merr.Add(f.Sync()); merr.Err() != nil {
|
||||||
|
merr.Add(f.Close())
|
||||||
|
return merr.Err()
|
||||||
|
}
|
||||||
|
|
||||||
if err = f.Close(); err != nil {
|
if err = f.Close(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue