summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.h
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2016-01-19 18:14:53 -0500
committerSpencer T Brody <spencer@mongodb.com>2016-01-21 16:22:38 -0500
commit38740c56f64ba791a681885737f975eb79640a0a (patch)
tree8c59283c4ec9e473513a58c33c83ba6788abbfe2 /src/mongo/db/cloner.h
parentf4a4d6944b47185230fe06dfcf06bc7cf6c5ac66 (diff)
downloadmongo-38740c56f64ba791a681885737f975eb79640a0a.tar.gz
SERVER-20036 Interrupt mapReduce and movePrimary commands on catalog manager change
Diffstat (limited to 'src/mongo/db/cloner.h')
-rw-r--r--src/mongo/db/cloner.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/cloner.h b/src/mongo/db/cloner.h
index 5a89f191dd1..e0e9ba306c4 100644
--- a/src/mongo/db/cloner.h
+++ b/src/mongo/db/cloner.h
@@ -30,8 +30,9 @@
#pragma once
-#include "mongo/client/dbclientinterface.h"
#include "mongo/base/disallow_copying.h"
+#include "mongo/client/dbclientinterface.h"
+#include "mongo/s/catalog/catalog_manager.h"
namespace mongo {
@@ -73,7 +74,7 @@ private:
const BSONObj& from_opts,
const NamespaceString& to_ns,
bool masterSameProcess,
- bool slaveOk,
+ const CloneOptions& opts,
Query q);
void copyIndexes(OperationContext* txn,
@@ -94,6 +95,10 @@ private:
* snapshot - use snapshot mode for copying collections. note this should not be used
* when it isn't required, as it will be slower. for example,
* repairDatabase need not use it.
+ * checkForCatalogChange - Internal option set for clone commands initiated by a mongos that are
+ * holding a distributed lock (such as movePrimary). Indicates that we need to
+ * be periodically checking to see if the catalog manager has swapped and fail
+ * if it has so that we don't block the mongos that initiated the command.
*/
struct CloneOptions {
std::string fromDB;
@@ -105,6 +110,8 @@ struct CloneOptions {
bool syncData = true;
bool syncIndexes = true;
+ bool checkForCatalogChange = false;
+ CatalogManager::ConfigServerMode initialCatalogMode = CatalogManager::ConfigServerMode::NONE;
};
} // namespace mongo