Merge pull request #848 from molecula/fix_843

don't panic if dbs is reopened under roaring only. fixes #843
This commit is contained in:
tgruben 2020-09-15 16:54:52 -05:00 committed by GitHub
commit 793cf934b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -405,7 +405,11 @@ func (per *DBPerShard) GetDBShard(index string, shard uint64, idx *Index) (dbs *
}
dbs, ok = dbi.Shard[shard]
if dbs != nil && dbs.closed {
panic(fmt.Sprintf("cannot retain closed dbs across holder ReOpen dbs='%p'", dbs))
if len(per.types) == 1 && per.types[0] == roaringTxn {
// roaring txn are nil/fake anyway. Don't freak out.
} else {
panic(fmt.Sprintf("cannot retain closed dbs across holder ReOpen dbs='%p'", dbs))
}
}
if !ok {
dbs = &DBShard{