Perform sanity check only if we have the storage it runs on

SanityCheckMapping is specific to roaring bitmaps stored in-memory, if
we have an RBF backend, we shouldn't even try it, it'll just panic.

This implies that, in whatever circumstance we were hitting this, we
were getting an error back from the backend. We still need to address
that error, but to do that we need to know what it was, which we don't
if we panic.
This commit is contained in:
Seebs 2021-11-23 10:00:08 -06:00
parent 769a750cdf
commit 14911bfdff

View file

@ -2485,7 +2485,7 @@ func (f *fragment) importPositions(tx Tx, set, clear []uint64, rowSet map[uint64
err = doFunc()
}
if err != nil {
if err != nil && f.storage != nil {
// we got an error. it's possible that the error indicates that something went wrong.
mappedIn, mappedOut, unmappedIn, errs, e2 := f.storage.SanityCheckMapping(f.currdata.from, f.currdata.to)
if errs != 0 {