Merge pull request #966 from molecula/fix843

pilosa/dbshard: allow deleteIndex and then re-use of index
This commit is contained in:
tgruben 2020-10-12 18:10:04 -05:00 committed by GitHub
commit db9e8cd8ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -320,6 +320,9 @@ func (per *DBPerShard) DeleteIndex(index string) (err error) {
}
}
}
// allow the index to be created again anew.
delete(per.dbh.Index, index)
return
}
@ -436,7 +439,7 @@ func (per *DBPerShard) GetDBShard(index string, shard uint64, idx *Index) (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))
panic(fmt.Sprintf("cannot retain closed dbs across holder ReOpen dbs='%p'; per.types[0]='%v'; len(per.types)=%v", dbs, per.types[0], len(per.types)))
}
}
if !ok {