diff options
author | Eric Milkie <milkie@10gen.com> | 2018-02-14 13:17:37 -0500 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2018-02-16 09:53:52 -0500 |
commit | a38cb8cf8e6382bee0feb843086fe985f4c94266 (patch) | |
tree | acd9bf0488959260d89a2daf51c34ba240cd43bd /src/mongo/db/catalog/database_holder.h | |
parent | 97fc082fcf2abc9428de053f88967b848ba36c7f (diff) | |
download | mongo-a38cb8cf8e6382bee0feb843086fe985f4c94266.tar.gz |
SERVER-33330 closeAll now checks for bg jobs in progress
Previously, closeAll() would have a "force" mode that caused it to either ignore bg jobs
in progress (force on), or avoid closing databases with bg jobs in progress. This parameter
is no longer useful, so I have removed it. The test-only restartCatalog command will now
return an error instead of crashing if you call it with bg jobs in progress.
Diffstat (limited to 'src/mongo/db/catalog/database_holder.h')
-rw-r--r-- | src/mongo/db/catalog/database_holder.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mongo/db/catalog/database_holder.h b/src/mongo/db/catalog/database_holder.h index 58af1747218..0edde9cfccf 100644 --- a/src/mongo/db/catalog/database_holder.h +++ b/src/mongo/db/catalog/database_holder.h @@ -57,10 +57,7 @@ public: virtual void close(OperationContext* opCtx, StringData ns, const std::string& reason) = 0; - virtual bool closeAll(OperationContext* opCtx, - BSONObjBuilder& result, - bool force, - const std::string& reason) = 0; + virtual void closeAll(OperationContext* opCtx, const std::string& reason) = 0; virtual std::set<std::string> getNamesWithConflictingCasing(StringData name) = 0; }; @@ -100,6 +97,7 @@ public: /** * Closes the specified database. Must be called with the database locked in X-mode. + * No background jobs must be in progress on the database when this function is called. */ inline void close(OperationContext* const opCtx, const StringData ns, @@ -109,16 +107,12 @@ public: /** * Closes all opened databases. Must be called with the global lock acquired in X-mode. + * Will uassert if any background jobs are running when this function is called. * - * @param result Populated with the names of the databases, which were closed. - * @param force Force close even if something underway - use at shutdown * @param reason The reason for close. */ - inline bool closeAll(OperationContext* const opCtx, - BSONObjBuilder& result, - const bool force, - const std::string& reason) { - return this->_impl().closeAll(opCtx, result, force, reason); + inline void closeAll(OperationContext* const opCtx, const std::string& reason) { + this->_impl().closeAll(opCtx, reason); } /** |