|
|
@ -521,7 +521,6 @@ func TestDB_Snapshot(t *testing.T) {
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
testutil.Ok(t, app.Rollback())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create snapshot
|
|
|
|
// create snapshot
|
|
|
|
snap, err := ioutil.TempDir("", "snap")
|
|
|
|
snap, err := ioutil.TempDir("", "snap")
|
|
|
@ -571,7 +570,6 @@ func TestDB_Snapshot_ChunksOutsideOfCompactedRange(t *testing.T) {
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
testutil.Ok(t, app.Rollback())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
snap, err := ioutil.TempDir("", "snap")
|
|
|
|
snap, err := ioutil.TempDir("", "snap")
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
testutil.Ok(t, err)
|
|
|
@ -939,10 +937,14 @@ func TestWALSegmentSizeOptions(t *testing.T) {
|
|
|
|
opts.WALSegmentSize = segmentSize
|
|
|
|
opts.WALSegmentSize = segmentSize
|
|
|
|
db := openTestDB(t, opts, nil)
|
|
|
|
db := openTestDB(t, opts, nil)
|
|
|
|
|
|
|
|
|
|
|
|
app := db.Appender()
|
|
|
|
|
|
|
|
for i := int64(0); i < 155; i++ {
|
|
|
|
for i := int64(0); i < 155; i++ {
|
|
|
|
_, err := app.Add(labels.Labels{labels.Label{Name: "wal", Value: "size"}}, i, rand.Float64())
|
|
|
|
app := db.Appender()
|
|
|
|
|
|
|
|
ref, err := app.Add(labels.Labels{labels.Label{Name: "wal" + fmt.Sprintf("%d", i), Value: "size"}}, i, rand.Float64())
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
|
|
|
|
for j := int64(1); j <= 78; j++ {
|
|
|
|
|
|
|
|
err := app.AddFast(ref, i+j, rand.Float64())
|
|
|
|
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
testutil.Ok(t, app.Commit())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2325,6 +2327,7 @@ func TestBlockRanges(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
// Test that wal records are skipped when an existing block covers the same time ranges
|
|
|
|
// Test that wal records are skipped when an existing block covers the same time ranges
|
|
|
|
// and compaction doesn't create an overlapping block.
|
|
|
|
// and compaction doesn't create an overlapping block.
|
|
|
|
|
|
|
|
app = db.Appender()
|
|
|
|
db.DisableCompactions()
|
|
|
|
db.DisableCompactions()
|
|
|
|
_, err = app.Add(lbl, secondBlockMaxt+1, rand.Float64())
|
|
|
|
_, err = app.Add(lbl, secondBlockMaxt+1, rand.Float64())
|
|
|
|
testutil.Ok(t, err)
|
|
|
|
testutil.Ok(t, err)
|
|
|
|