summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2017-10-26 18:34:38 -0400
committerMisha Tyulenev <misha@mongodb.com>2017-10-26 18:37:04 -0400
commit54f044558c0845adcc6b51c2351e8382a3e9bbd7 (patch)
tree298fe9462d1e77ae5eec6d5672bb047fb5441577 /src/mongo/db/commands.h
parent260fd0c76599520d9d733874753a94a2db763538 (diff)
downloadmongo-54f044558c0845adcc6b51c2351e8382a3e9bbd7.tar.gz
SERVER-31613 disallow afterClusterTime on some commands
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r--src/mongo/db/commands.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h
index 5a2f31c460a..6d0a9d65a1e 100644
--- a/src/mongo/db/commands.h
+++ b/src/mongo/db/commands.h
@@ -208,6 +208,13 @@ public:
const BSONObj& cmdObj) const = 0;
/**
+ * Returns true if command allows afterClusterTime in its readConcern. The command may not allow
+ * it if it is specifically intended not to take any LockManager locks. Waiting for
+ * afterClusterTime takes the MODE_IS lock.
+ */
+ virtual bool allowsAfterClusterTime(const BSONObj& cmdObj) const = 0;
+
+ /**
* Returns LogicalOp for this command.
*/
virtual LogicalOp getLogicalOp() const = 0;
@@ -321,6 +328,10 @@ public:
return false;
}
+ bool allowsAfterClusterTime(const BSONObj& cmdObj) const override {
+ return true;
+ }
+
LogicalOp getLogicalOp() const override {
return LogicalOp::opCommand;
}