mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
Merge pull request #106 from Gouthamve/snapshot-time
Persist the right MaxTime when snapshotting
This commit is contained in:
commit
969c407335
2 changed files with 2 additions and 1 deletions
2
db.go
2
db.go
|
|
@ -710,7 +710,7 @@ func (db *DB) ensureHead(t int64) error {
|
|||
}
|
||||
// Create another block of buffer in front if the DB is initialized or retrieving
|
||||
// new data after a long gap.
|
||||
// This ensures we always have a full block width if append window.
|
||||
// This ensures we always have a full block width of append window.
|
||||
if addBuffer {
|
||||
if _, err := db.createHeadBlock(mint-int64(db.opts.MinBlockDuration), mint); err != nil {
|
||||
return err
|
||||
|
|
|
|||
1
head.go
1
head.go
|
|
@ -302,6 +302,7 @@ func (h *HeadBlock) Snapshot(snapshotDir string) error {
|
|||
return errors.Wrap(err, "write snapshot")
|
||||
}
|
||||
meta.ULID = uid
|
||||
meta.MaxTime = h.highTimestamp
|
||||
|
||||
if err = writeMetaFile(tmp, meta); err != nil {
|
||||
return errors.Wrap(err, "write merged meta")
|
||||
|
|
|
|||
Loading…
Reference in a new issue