summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern_options.cpp
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2020-02-16 04:51:35 +0000
committerevergreen <evergreen@mongodb.com>2020-02-16 04:51:35 +0000
commit95c8fc6a4a98f70b07f32565e3ef3e48172efa1e (patch)
tree5a4288ed6451cee86fdd319dcb52a592ec387c0e /src/mongo/db/write_concern_options.cpp
parent1d21e89fa5c9d838b2f40045c26fe41f306a8873 (diff)
downloadmongo-95c8fc6a4a98f70b07f32565e3ef3e48172efa1e.tar.gz
SERVER-45623 read/write concern provenance
Diffstat (limited to 'src/mongo/db/write_concern_options.cpp')
-rw-r--r--src/mongo/db/write_concern_options.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp
index f24ec703469..298941fbdef 100644
--- a/src/mongo/db/write_concern_options.cpp
+++ b/src/mongo/db/write_concern_options.cpp
@@ -131,6 +131,13 @@ StatusWith<WriteConcernOptions> WriteConcernOptions::parse(const BSONObj& obj) {
// Ignore.
} else if (fieldName.equalCaseInsensitive(kGetLastErrorFieldName)) {
// Ignore GLE field.
+ } else if (fieldName == ReadWriteConcernProvenance::kSourceFieldName) {
+ try {
+ writeConcern._provenance = ReadWriteConcernProvenance::parse(
+ IDLParserErrorContext("WriteConcernOptions::parse"), obj);
+ } catch (const DBException&) {
+ return exceptionToStatus();
+ }
} else {
return Status(ErrorCodes::FailedToParse,
str::stream() << "unrecognized write concern field: " << fieldName);
@@ -234,6 +241,8 @@ BSONObj WriteConcernOptions::toBSON() const {
builder.append("wtimeout", wTimeout);
+ _provenance.serialize(&builder);
+
return builder.obj();
}