Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ func Checkpoint(w *wal.WAL, from, to int, keep func(id uint64) bool, mint int64)
}
last := idx + 1
if err == nil {
if from > last {
return nil, fmt.Errorf("unexpected gap to last checkpoint. expected:%v, requested:%v", last, from)
}
// Ignore WAL files below the checkpoint. They shouldn't exist to begin with.
from = last

Expand Down
5 changes: 5 additions & 0 deletions head.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ func (h *Head) Truncate(mint int64) (err error) {
if last <= first {
return nil
}
_, idx, err := LastCheckpoint(h.wal.Dir())
expFirst := idx + 1
if err == nil && first != expFirst {
level.Error(h.logger).Log("msg", "unexpected wal segment gap to last checkpoint", "expected", expFirst, "actual", first)
}

keep := func(id uint64) bool {
return h.series.getByID(id) != nil
Expand Down