snapshot: Remove truncation check to restore func.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
parent
c9fc2af6c0
commit
203012169a
3
head.go
3
head.go
|
@ -249,9 +249,6 @@ func (h *Head) ReadWAL() error {
|
|||
func (h *Head) Truncate(mint int64) error {
|
||||
initialize := h.MinTime() == math.MinInt64
|
||||
|
||||
if mint%h.chunkRange != 0 {
|
||||
return errors.Errorf("truncating at %d not aligned", mint)
|
||||
}
|
||||
if h.MinTime() >= mint {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -187,8 +187,8 @@ func TestHead_Truncate(t *testing.T) {
|
|||
}
|
||||
s4.chunks = []*memChunk{}
|
||||
|
||||
// Truncation must be aligned.
|
||||
require.Error(t, h.Truncate(1))
|
||||
// Truncation need not be aligned.
|
||||
require.NoError(t, h.Truncate(1))
|
||||
|
||||
h.Truncate(2000)
|
||||
|
||||
|
|
Loading…
Reference in New Issue