diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-09-24 16:27:58 -0400 |
---|---|---|
committer | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-04 11:22:05 -0400 |
commit | c589abf31b748d0f13e710d8d59394b65ab6891d (patch) | |
tree | 637288a6b560f8906bc0dd6ff3bf1b55eb709b79 /src/mongo/db/curop.cpp | |
parent | f9436146f64ad7caa2ce525c1d75a85f918d68c0 (diff) | |
download | mongo-c589abf31b748d0f13e710d8d59394b65ab6891d.tar.gz |
SERVER-37005 Add fields to GenericCursor
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index 34df70eccb9..361ca3220b2 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -500,7 +500,15 @@ void CurOp::reportState(BSONObjBuilder* builder, bool truncateOps) { "truncatedObj", _genericCursor->getOriginatingCommand().get(), maxQuerySize, &tempObj); auto originatingCommand = tempObj.done().getObjectField("truncatedObj"); _genericCursor->setOriginatingCommand(originatingCommand.getOwned()); + // lsid and ns exist in the top level curop object, so they need to be temporarily + // removed from the cursor object to avoid duplicating information. + auto lsid = _genericCursor->getLsid(); + auto ns = _genericCursor->getNs(); + _genericCursor->setLsid(boost::none); + _genericCursor->setNs(boost::none); builder->append("cursor", _genericCursor->toBSON()); + _genericCursor->setLsid(lsid); + _genericCursor->setNs(ns); } if (!_message.empty()) { |