diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-09 15:11:00 -0400 |
---|---|---|
committer | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-10 15:32:32 -0400 |
commit | a6b69577d2576c857cbb971448e432ec4a50c08e (patch) | |
tree | 8c5a4cd339a2467da020a20fbdb189473f11b9f1 | |
parent | 796d1d15226e546485d356f1c41d94e8d11281ca (diff) | |
download | mongo-a6b69577d2576c857cbb971448e432ec4a50c08e.tar.gz |
SERVER-37460 Add type to all currentOp documents
-rw-r--r-- | jstests/core/currentop.js | 3 | ||||
-rw-r--r-- | jstests/sharding/aggregation_currentop.js | 1 | ||||
-rw-r--r-- | src/mongo/db/curop.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/transaction_participant.cpp | 1 |
4 files changed, 6 insertions, 1 deletions
diff --git a/jstests/core/currentop.js b/jstests/core/currentop.js index a88c0ded2bf..e4c94dd67ea 100644 --- a/jstests/core/currentop.js +++ b/jstests/core/currentop.js @@ -38,7 +38,8 @@ {ns: coll.getFullName()}, {ns: db.$cmd.getFullName(), "command.insert": coll.getName()} ] - } + }, + {type: "op"} ] }); return ops.inprog.length === 1; diff --git a/jstests/sharding/aggregation_currentop.js b/jstests/sharding/aggregation_currentop.js index 965ead4d15b..66e2fa43554 100644 --- a/jstests/sharding/aggregation_currentop.js +++ b/jstests/sharding/aggregation_currentop.js @@ -622,6 +622,7 @@ TestData.skipAwaitingReplicationOnShardsBeforeCheckingUUIDs = true; // Returns a set of predicates that filter $currentOp for all stashed transactions. function sessionFilter() { return { + type: "idleSession", active: false, opid: {$exists: false}, desc: "inactive transaction", diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index 361ca3220b2..c7768fb34fd 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -230,6 +230,8 @@ void CurOp::reportCurrentOpForClient(OperationContext* opCtx, invariant(client); OperationContext* clientOpCtx = client->getOperationContext(); + infoBuilder->append("type", "op"); + const std::string hostName = getHostNameCachedAndPort(); infoBuilder->append("host", hostName); diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp index b3e1d73c17b..6d870f6802f 100644 --- a/src/mongo/db/transaction_participant.cpp +++ b/src/mongo/db/transaction_participant.cpp @@ -1264,6 +1264,7 @@ void TransactionParticipant::reportStashedState(BSONObjBuilder* builder) const { if (_txnResourceStash && _txnResourceStash->locker()) { if (auto lockerInfo = _txnResourceStash->locker()->getLockerInfo(boost::none)) { invariant(_activeTxnNumber != kUninitializedTxnNumber); + builder->append("type", "idleSession"); builder->append("host", getHostNameCachedAndPort()); builder->append("desc", "inactive transaction"); |