mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -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/prometheus/tsdb/encoding"
|
||||
tsdb_errors "github.com/prometheus/tsdb/errors"
|
||||
)
|
||||
|
||||
const tombstoneFilename = "tombstones"
|
||||
|
@ -100,6 +101,12 @@ func writeTombstoneFile(dir string, tr TombstoneReader) error {
|
|||
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 {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue