summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.h
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2014-01-13 18:50:02 -0500
committerGreg Studer <greg@10gen.com>2014-01-14 14:41:04 -0500
commit13226efcd6638b707e0f4a64564d655cea9bc9c7 (patch)
tree8f8a80c77f7048116f6d63b9d8d349de36189c73 /src/mongo/db/write_concern.h
parent20a414a4809aa5d20f3a09f129f08c918cddf032 (diff)
downloadmongo-13226efcd6638b707e0f4a64564d655cea9bc9c7.tar.gz
SERVER-12274 refactor validation out of waiting for write concern
Diffstat (limited to 'src/mongo/db/write_concern.h')
-rw-r--r--src/mongo/db/write_concern.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/db/write_concern.h b/src/mongo/db/write_concern.h
index 6253bfd5107..69c438d3ba3 100644
--- a/src/mongo/db/write_concern.h
+++ b/src/mongo/db/write_concern.h
@@ -32,6 +32,11 @@
namespace mongo {
+ /**
+ * Verifies that a WriteConcern is valid for this particular host.
+ */
+ Status validateWriteConcern( const WriteConcernOptions& writeConcern );
+
struct WriteConcernResult {
WriteConcernResult() {
reset();
@@ -59,15 +64,15 @@ namespace mongo {
/**
* Blocks until the database is sure the specified user write concern has been fulfilled, or
- * returns an error status if the write concern fails.
+ * returns an error status if the write concern fails. Does no validation of the input write
+ * concern, it is an error to pass this function an invalid write concern for the host.
*
* Takes a user write concern as well as the replication opTime the write concern applies to -
* if this opTime.isNull() no replication-related write concern options will be enforced.
*
* Returns result of the write concern if successful.
- * Returns !OK if anything goes wrong.
- * Returns WriteConcernLegacyOK if the write concern could not be applied but legacy GLE should
- * not report an error.
+ * Returns NotMaster if the host steps down while waiting for replication
+ * Returns UnknownReplWriteConcern if the wMode specified was not enforceable
*/
Status waitForWriteConcern( const WriteConcernOptions& writeConcern,
const OpTime& replOpTime,