diff options
author | Misha Tyulenev <misha@mongodb.com> | 2016-10-14 13:25:36 -0400 |
---|---|---|
committer | Misha Tyulenev <misha@mongodb.com> | 2016-10-14 13:26:38 -0400 |
commit | 759bd57056d51ac856296e4c9672f1ea2efe4b33 (patch) | |
tree | 5d26daac0bc85bd0e759f29bcfeadfa0edd4ae1b /src/mongo/rpc/metadata.cpp | |
parent | 8c089d6541f909e018f5067bdb2cd8c512570929 (diff) | |
download | mongo-759bd57056d51ac856296e4c9672f1ea2efe4b33.tar.gz |
SERVER-26506 add tracking for commands
Diffstat (limited to 'src/mongo/rpc/metadata.cpp')
-rw-r--r-- | src/mongo/rpc/metadata.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/rpc/metadata.cpp b/src/mongo/rpc/metadata.cpp index d286ece26ca..00a9d58dc9f 100644 --- a/src/mongo/rpc/metadata.cpp +++ b/src/mongo/rpc/metadata.cpp @@ -37,6 +37,7 @@ #include "mongo/rpc/metadata/config_server_metadata.h" #include "mongo/rpc/metadata/server_selection_metadata.h" #include "mongo/rpc/metadata/sharding_metadata.h" +#include "mongo/rpc/metadata/tracking_metadata.h" namespace mongo { namespace rpc { @@ -49,6 +50,7 @@ Status readRequestMetadata(OperationContext* txn, const BSONObj& metadataObj) { BSONElement ssmElem; BSONElement auditElem; BSONElement configSvrElem; + BSONElement trackingElem; BSONElement clientElem; for (const auto& metadataElem : metadataObj) { @@ -61,6 +63,8 @@ Status readRequestMetadata(OperationContext* txn, const BSONObj& metadataObj) { configSvrElem = metadataElem; } else if (fieldName == ClientMetadata::fieldName()) { clientElem = metadataElem; + } else if (fieldName == TrackingMetadata::fieldName()) { + trackingElem = metadataElem; } } @@ -88,6 +92,12 @@ Status readRequestMetadata(OperationContext* txn, const BSONObj& metadataObj) { } ConfigServerMetadata::get(txn) = std::move(configServerMetadata.getValue()); + auto trackingMetadata = TrackingMetadata::readFromMetadata(trackingElem); + if (!trackingMetadata.isOK()) { + return trackingMetadata.getStatus(); + } + TrackingMetadata::get(txn) = std::move(trackingMetadata.getValue()); + return Status::OK(); } |