summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-08-04 09:35:48 -0400
committerEliot Horowitz <eliot@10gen.com>2014-08-05 08:51:41 -0400
commit568f6de65c6e9a88a26aa2e10b12cb68ae0f1b06 (patch)
treed52d30d95e6f2c0fcfbac7eec1e0c0dbff4333ad /src/mongo/db/catalog
parentf8003b264fe6c7a73fdfefd969983a885ef52958 (diff)
downloadmongo-568f6de65c6e9a88a26aa2e10b12cb68ae0f1b06.tar.gz
SERVER-13635: change ownership of DatabaseCatalogEntry, now StorageEngine owns
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r--src/mongo/db/catalog/database.cpp2
-rw-r--r--src/mongo/db/catalog/database.h4
-rw-r--r--src/mongo/db/catalog/database_holder.cpp4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/catalog/database.cpp b/src/mongo/db/catalog/database.cpp
index f3c8179b9e7..fa0b78ad859 100644
--- a/src/mongo/db/catalog/database.cpp
+++ b/src/mongo/db/catalog/database.cpp
@@ -524,7 +524,7 @@ namespace mongo {
}
const DatabaseCatalogEntry* Database::getDatabaseCatalogEntry() const {
- return _dbEntry.get();
+ return _dbEntry;
}
void dropAllDatabasesExceptLocal(OperationContext* txn) {
diff --git a/src/mongo/db/catalog/database.h b/src/mongo/db/catalog/database.h
index 2b080f063de..40c6903ea5c 100644
--- a/src/mongo/db/catalog/database.h
+++ b/src/mongo/db/catalog/database.h
@@ -59,7 +59,7 @@ namespace mongo {
// you probably need to be in dbHolderMutex when constructing this
Database(OperationContext* txn,
const StringData& name,
- DatabaseCatalogEntry* dbEntry );
+ DatabaseCatalogEntry* dbEntry ); // not owner here
// must call close first
~Database();
@@ -144,7 +144,7 @@ namespace mongo {
const std::string _name; // "alleyinsider"
- boost::scoped_ptr<DatabaseCatalogEntry> _dbEntry;
+ DatabaseCatalogEntry* _dbEntry; // not owned here
const std::string _profileName; // "alleyinsider.system.profile"
const std::string _indexesName; // "alleyinsider.system.indexes"
diff --git a/src/mongo/db/catalog/database_holder.cpp b/src/mongo/db/catalog/database_holder.cpp
index 8b494631d67..6d129153add 100644
--- a/src/mongo/db/catalog/database_holder.cpp
+++ b/src/mongo/db/catalog/database_holder.cpp
@@ -135,6 +135,8 @@ namespace mongo {
it->second->close( txn );
delete it->second;
_dbs.erase( db );
+
+ getGlobalEnvironment()->getGlobalStorageEngine()->closeDatabase( txn, db.toString() );
}
bool DatabaseHolder::closeAll(OperationContext* txn,
@@ -173,6 +175,8 @@ namespace mongo {
_dbs.erase( name );
+ getGlobalEnvironment()->getGlobalStorageEngine()->closeDatabase( txn, name );
+
bb.append( name );
}