summaryrefslogtreecommitdiff
path: root/src/mongo/db/read_concern.h
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-03-14 12:34:23 -0400
committerLouis Williams <louis.williams@mongodb.com>2019-03-19 17:03:40 -0400
commit197233a97c2a8859b82ba1ffeac97ba2719f6470 (patch)
tree56d7bfb37a6957c27bc7ee13c062086742a59fa9 /src/mongo/db/read_concern.h
parent81d045a17ddf08e9f0eb7f30f96b45a352fab5cc (diff)
downloadmongo-197233a97c2a8859b82ba1ffeac97ba2719f6470.tar.gz
SERVER-39074 All operations enforce prepare conflicts by default
Prepare conflicts may only be safely ignored when a command can guarantee it does not perform writes. Prepare conflicts are ignored when the read concern is local, available, or majority and the command is aggregate, count, distinct, find, getMore, or group. Aggregate is a special case because it may perform writes to an output collection, but it enables prepare conflict enforcement before doing so. Additionally, connections from a DBDirectClient inherit the ignore_prepare state from their parent operation.
Diffstat (limited to 'src/mongo/db/read_concern.h')
-rw-r--r--src/mongo/db/read_concern.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/read_concern.h b/src/mongo/db/read_concern.h
index 2fd42beb71f..5f66a46f26c 100644
--- a/src/mongo/db/read_concern.h
+++ b/src/mongo/db/read_concern.h
@@ -43,16 +43,17 @@ class ReadConcernArgs;
class SpeculativeMajorityReadInfo;
}
-
/**
* Given the specified read concern arguments, performs checks that the read concern can actually be
* satisfied given the current state of the server and if so calls into the replication subsystem to
* perform the wait. If allowAfterClusterTime is false returns an error if afterClusterTime is
- * set on the readConcernArgs.
+ * set on the readConcernArgs. Both cmdName and readConcernArgs are used to determine whether or not
+ * prepare conflicts can be ignored.
*/
extern MONGO_DECLARE_SHIM((OperationContext * opCtx,
const repl::ReadConcernArgs& readConcernArgs,
- bool allowAfterClusterTime)
+ bool allowAfterClusterTime,
+ StringData cmdName)
->Status) waitForReadConcern;
/*