MCPcopy
hub / github.com/dgraph-io/dgraph / jepsen

Function jepsen

dgraph/cmd/debug/run.go:338–363  ·  view source on GitHub ↗
(db *badger.DB)

Source from the content-addressed store, hash-verified

336}
337
338func jepsen(db *badger.DB) {
339 min, max := getMinMax(db, opt.readTs)
340 fmt.Printf("min=%d. max=%d\n", min, max)
341
342 var ts uint64
343 switch opt.jepsen {
344 case "binary":
345 ts = findFirstInvalidTxn(db, min, max)
346 case "linear":
347 ts = findFirstValidTxn(db)
348 }
349 fmt.Println()
350 if ts == 0 {
351 fmt.Println("Nothing found. Exiting.")
352 return
353 }
354 showAllPostingsAt(db, ts)
355 seekTotal(db, ts-1)
356
357 for range 5 {
358 // Get a few previous commits.
359 _, ts = getMinMax(db, ts-1)
360 showAllPostingsAt(db, ts)
361 seekTotal(db, ts-1)
362 }
363}
364
365func history(lookup []byte, itr *badger.Iterator) {
366 var buf bytes.Buffer

Callers 1

runFunction · 0.85

Calls 5

getMinMaxFunction · 0.85
findFirstInvalidTxnFunction · 0.85
findFirstValidTxnFunction · 0.85
showAllPostingsAtFunction · 0.85
seekTotalFunction · 0.85

Tested by

no test coverage detected