diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-06-02 16:32:25 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-06-02 22:55:05 -0400 |
commit | e5da18f2dfbd71fb997734b524e5e4306d0af550 (patch) | |
tree | 25d2d291a47414967b4f5b5974ce7be80f7ff843 /src/mongo/db/repair_database.cpp | |
parent | 8c9fcc939f9f1a2b593e606bd790cc87efd4064f (diff) | |
download | mongo-e5da18f2dfbd71fb997734b524e5e4306d0af550.tar.gz |
SERVER-13961 Remove all 'checking' variants of dbHolder
All places which call dbHolder are verifiably under the appropriate lock,
so there is no need to do checking. This allows for the Lock::isLocked
check to be removed from there.
Diffstat (limited to 'src/mongo/db/repair_database.cpp')
-rw-r--r-- | src/mongo/db/repair_database.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp index aac1c1b3eca..23f617877f2 100644 --- a/src/mongo/db/repair_database.cpp +++ b/src/mongo/db/repair_database.cpp @@ -276,6 +276,9 @@ namespace mongo { string dbName, bool preserveClonedFilesOnFailure, bool backupOriginalFiles ) { + // We must hold some form of lock here + invariant(txn->lockState()->threadState()); + scoped_ptr<RepairFileDeleter> repairFileDeleter; doingRepair dr; dbName = nsToDatabase( dbName ); @@ -311,14 +314,17 @@ namespace mongo { reservedPath ) ); { - Database* originalDatabase = dbHolder().get( dbName, storageGlobalParams.dbpath ); - if ( originalDatabase == NULL ) - return Status( ErrorCodes::NamespaceNotFound, "database does not exist to repair" ); + Database* originalDatabase = + dbHolder().get(dbName, storageGlobalParams.dbpath); + if (originalDatabase == NULL) { + return Status(ErrorCodes::NamespaceNotFound, "database does not exist to repair"); + } Database* tempDatabase = NULL; { bool justCreated = false; - tempDatabase = dbHolderW().getOrCreate(txn, dbName, reservedPathString, justCreated); + tempDatabase = + dbHolder().getOrCreate(txn, dbName, reservedPathString, justCreated); invariant( justCreated ); } |