summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/process_interface
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/process_interface')
-rw-r--r--src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp4
-rw-r--r--src/mongo/db/pipeline/process_interface/common_mongod_process_interface.h2
-rw-r--r--src/mongo/db/pipeline/process_interface/common_process_interface.cpp15
-rw-r--r--src/mongo/db/pipeline/process_interface/common_process_interface.h2
-rw-r--r--src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp4
-rw-r--r--src/mongo/db/pipeline/process_interface/mongos_process_interface.h2
6 files changed, 19 insertions, 10 deletions
diff --git a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
index c3db7716d48..d90d2049c7b 100644
--- a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
@@ -645,13 +645,13 @@ bool CommonMongodProcessInterface::fieldsHaveSupportingUniqueIndex(
}
BSONObj CommonMongodProcessInterface::_reportCurrentOpForClient(
- OperationContext* opCtx,
+ const boost::intrusive_ptr<ExpressionContext>& expCtx,
Client* client,
CurrentOpTruncateMode truncateOps,
CurrentOpBacktraceMode backtraceMode) const {
BSONObjBuilder builder;
- CurOp::reportCurrentOpForClient(opCtx,
+ CurOp::reportCurrentOpForClient(expCtx,
client,
(truncateOps == CurrentOpTruncateMode::kTruncateOps),
(backtraceMode == CurrentOpBacktraceMode::kIncludeBacktrace),
diff --git a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.h b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.h
index 07e2d0370ce..0bc59bf7c4f 100644
--- a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.h
+++ b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.h
@@ -145,7 +145,7 @@ protected:
const Document& documentKey,
MakePipelineOptions opts);
- BSONObj _reportCurrentOpForClient(OperationContext* opCtx,
+ BSONObj _reportCurrentOpForClient(const boost::intrusive_ptr<ExpressionContext>& expCtx,
Client* client,
CurrentOpTruncateMode truncateOps,
CurrentOpBacktraceMode backtraceMode) const final;
diff --git a/src/mongo/db/pipeline/process_interface/common_process_interface.cpp b/src/mongo/db/pipeline/process_interface/common_process_interface.cpp
index 5cf57474365..ab08e47625a 100644
--- a/src/mongo/db/pipeline/process_interface/common_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/common_process_interface.cpp
@@ -109,7 +109,7 @@ std::vector<BSONObj> CommonProcessInterface::getCurrentOps(
}
// Delegate to the mongoD- or mongoS-specific implementation of _reportCurrentOpForClient.
- ops.emplace_back(_reportCurrentOpForClient(opCtx, client, truncateMode, backtraceMode));
+ ops.emplace_back(_reportCurrentOpForClient(expCtx, client, truncateMode, backtraceMode));
}
// If 'cursorMode' is set to include idle cursors, retrieve them and add them to ops.
@@ -120,8 +120,17 @@ std::vector<BSONObj> CommonProcessInterface::getCurrentOps(
cursorObj.append("type", "idleCursor");
cursorObj.append("host", getHostNameCachedAndPort());
// First, extract fields which need to go at the top level out of the GenericCursor.
- auto ns = cursor.getNs();
- cursorObj.append("ns", ns ? NamespaceStringUtil::serialize(*ns) : "");
+ if (auto ns = cursor.getNs()) {
+ tassert(7663401,
+ str::stream()
+ << "SerializationContext on the expCtx should not be empty, with ns: "
+ << ns->ns(),
+ expCtx->serializationCtxt != SerializationContext::stateDefault());
+ cursorObj.append("ns",
+ NamespaceStringUtil::serialize(*ns, expCtx->serializationCtxt));
+ } else
+ cursorObj.append("ns", "");
+
if (auto lsid = cursor.getLsid()) {
cursorObj.append("lsid", lsid->toBSON());
}
diff --git a/src/mongo/db/pipeline/process_interface/common_process_interface.h b/src/mongo/db/pipeline/process_interface/common_process_interface.h
index 4a4f1d1e990..46981e7dda1 100644
--- a/src/mongo/db/pipeline/process_interface/common_process_interface.h
+++ b/src/mongo/db/pipeline/process_interface/common_process_interface.h
@@ -154,7 +154,7 @@ protected:
* executed by the supplied client. This method is called by the getCurrentOps method of
* CommonProcessInterface to delegate to the mongoS- or mongoD- specific implementation.
*/
- virtual BSONObj _reportCurrentOpForClient(OperationContext* opCtx,
+ virtual BSONObj _reportCurrentOpForClient(const boost::intrusive_ptr<ExpressionContext>& expCtx,
Client* client,
CurrentOpTruncateMode truncateOps,
CurrentOpBacktraceMode backtraceMode) const = 0;
diff --git a/src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp b/src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp
index 33e900c06a9..2e804e368d4 100644
--- a/src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp
@@ -259,13 +259,13 @@ boost::optional<Document> MongosProcessInterface::lookupSingleDocumentLocally(
}
BSONObj MongosProcessInterface::_reportCurrentOpForClient(
- OperationContext* opCtx,
+ const boost::intrusive_ptr<ExpressionContext>& expCtx,
Client* client,
CurrentOpTruncateMode truncateOps,
CurrentOpBacktraceMode backtraceMode) const {
BSONObjBuilder builder;
- CurOp::reportCurrentOpForClient(opCtx,
+ CurOp::reportCurrentOpForClient(expCtx,
client,
(truncateOps == CurrentOpTruncateMode::kTruncateOps),
(backtraceMode == CurrentOpBacktraceMode::kIncludeBacktrace),
diff --git a/src/mongo/db/pipeline/process_interface/mongos_process_interface.h b/src/mongo/db/pipeline/process_interface/mongos_process_interface.h
index 0ea14f6dcc2..ce70e71db25 100644
--- a/src/mongo/db/pipeline/process_interface/mongos_process_interface.h
+++ b/src/mongo/db/pipeline/process_interface/mongos_process_interface.h
@@ -310,7 +310,7 @@ public:
}
protected:
- BSONObj _reportCurrentOpForClient(OperationContext* opCtx,
+ BSONObj _reportCurrentOpForClient(const boost::intrusive_ptr<ExpressionContext>& expCtx,
Client* client,
CurrentOpTruncateMode truncateOps,
CurrentOpBacktraceMode backtraceMode) const final;