(db *badger.DB)
| 206 | } |
| 207 | |
| 208 | func findFirstValidTxn(db *badger.DB) uint64 { |
| 209 | readTs := opt.readTs |
| 210 | var wrong uint64 |
| 211 | for { |
| 212 | min, max := getMinMax(db, readTs-1) |
| 213 | if max <= min { |
| 214 | fmt.Printf("Can't find it. Max: %d\n", max) |
| 215 | return 0 |
| 216 | } |
| 217 | readTs = max |
| 218 | if total := seekTotal(db, readTs); total != 100 { |
| 219 | fmt.Printf("===> VIOLATION at ts: %d\n", readTs) |
| 220 | showAllPostingsAt(db, readTs) |
| 221 | wrong = readTs |
| 222 | } else { |
| 223 | fmt.Printf("===> Found first correct version at %d\n", readTs) |
| 224 | showAllPostingsAt(db, readTs) |
| 225 | return wrong |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | func findFirstInvalidTxn(db *badger.DB, lowTs, highTs uint64) uint64 { |
| 231 | fmt.Println() |
no test coverage detected