From b3e6cdc0d8f4a334380ec93c2ff65626c9fd44f0 Mon Sep 17 00:00:00 2001 From: "Jason E. Aten" Date: Mon, 12 Oct 2020 17:44:40 -0500 Subject: [PATCH] pilosa/dbshard: allow deleteIndex and then re-use of index - fixes #843 --- dbshard.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbshard.go b/dbshard.go index c2e0b3dbe..27bc4c6f9 100644 --- a/dbshard.go +++ b/dbshard.go @@ -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 {