You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typePebbleStorageTestSuitestruct {
suite.Suite// github.com/stretchr/testify
}
func (t*PebbleStorageTestSuite) TestExtremeLogLoad() {
constmaxCount=10_000_000store, err:=NewPebbleStorage(t.conf)
deferstore.Close()
t.Require().Nil(err)
varlogs []*raft.Logfori:=uint64(0); i<maxCount; i++ {
logs=append(logs, &raft.Log{
Index: i,
Term: i,
})
}
store.logger.Info("storing logs", "count", maxCount)
err=store.StoreLogs(logs)
t.Require().Nil(err, "there must not be an error submitting %d logs", maxCount)
store.logger.Info("logs stored", "count", maxCount)
ranges:=utilities.GenerateRanges(0, maxCount, 10_000)
errG:=new(errgroup.Group)
foridx:=rangeranges {
errG.Go(func() error {
foriter:=ranges[idx].From; iter<ranges[idx].To; iter++ {
varlog raft.Logerr=store.GetLog(iter, &log)
t.Require().NoError(err, "there must not be an error fetching log index %d", iter)
t.Require().Equal(iter, log.Index, "log index %d must match", iter)
t.Require().Equal(iter, log.Term, "log term %d must match", iter)
}
returnnil
})
}
t.Require().NoError(errG.Wait(), "there must not be any errors fetching raft keys")
}
I'm consistently getting 10+ pebble: not found errors on keys despite all batches having sync points plus a final flush to disk, so I suspect I'm doing something wrong. I was reading the docs on large batches, but I don't know what I'm doing wrong. I have noticed most of the keys that aren't found are the same keys, so I suspect there's internal sync issues but I expected the forced sync points to alleviate that.
What is the right way to sync large batch inserts for immediate reads for stress testing?
One thing I'm seeing is that you are capturing idx inside the func of a goroutine which until Go 1.22 was a mistake (https://go.dev/blog/loopvar-preview). What version of Go are you using?
Overall the way the API is used is correct, this should be working. There must be some detail that's wrong. Could I get a pointer to utilities.GenerateRanges? Just want to check that To is indeed exclusive as this code assumes.
// IteratorRange represents a range of numbers to chunk slices into.typeIteratorRangestruct{ From, Touint64 }
// GenerateRanges generates a list of ranges from min to max with a batch size.funcGenerateRanges(min, maxuint64, batchSizeuint64) []IteratorRange {
ifbatchSize==0 {
batchSize=1
}
varranges []IteratorRange// this has to be from <= max to include the last batchforfrom:=min; from<=max; from+=batchSize {
// without -1 the first batch will be 10-20 and the second batch will be 20-30// with -1 the first batch will be 10-19 and the second batch will be 20-29to:= (from+batchSize) -1ifto>max {
to=max
}
ranges=append(ranges, IteratorRange{from, to})
}
returnranges
}
I'm working on implementing load tests for a raft implementation on top of Pebble, and I'm running into sync issues with inserting many large batches.
Here's a snippet of log storage and fetching
Here's my stress test:
I'm consistently getting 10+
pebble: not found
errors on keys despite all batches having sync points plus a final flush to disk, so I suspect I'm doing something wrong. I was reading the docs on large batches, but I don't know what I'm doing wrong. I have noticed most of the keys that aren't found are the same keys, so I suspect there's internal sync issues but I expected the forced sync points to alleviate that.What is the right way to sync large batch inserts for immediate reads for stress testing?
Jira issue: PEBBLE-40
The text was updated successfully, but these errors were encountered: