summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/noPassthrough/indexbg_killop_primary.js2
-rw-r--r--jstests/noPassthrough/indexbg_killop_secondary.js2
-rw-r--r--src/mongo/db/index_builds_coordinator.cpp1
3 files changed, 3 insertions, 2 deletions
diff --git a/jstests/noPassthrough/indexbg_killop_primary.js b/jstests/noPassthrough/indexbg_killop_primary.js
index ca0d7e9bbe0..daf0fee1f39 100644
--- a/jstests/noPassthrough/indexbg_killop_primary.js
+++ b/jstests/noPassthrough/indexbg_killop_primary.js
@@ -43,7 +43,7 @@ IndexBuildTest.assertIndexBuildCurrentOpContents(testDB, opId, (op) => {
op.connectionId,
'Was expecting IndexBuildsCoordinator op; found db.currentOp() for connection thread instead: ' +
tojson(op));
- assert.eq('',
+ assert.eq(coll.getFullName(),
op.ns,
'Unexpected ns field value in db.currentOp() result for index build: ' + tojson(op));
});
diff --git a/jstests/noPassthrough/indexbg_killop_secondary.js b/jstests/noPassthrough/indexbg_killop_secondary.js
index 3628243108f..d4cbe816c37 100644
--- a/jstests/noPassthrough/indexbg_killop_secondary.js
+++ b/jstests/noPassthrough/indexbg_killop_secondary.js
@@ -41,7 +41,7 @@ const opId = IndexBuildTest.waitForIndexBuildToStart(secondaryDB);
IndexBuildTest.assertIndexBuildCurrentOpContents(secondaryDB, opId, (op) => {
jsTestLog('Inspecting db.currentOp() entry for index build: ' + tojson(op));
- assert.eq('',
+ assert.eq(coll.getFullName(),
op.ns,
'Unexpected ns field value in db.currentOp() result for index build: ' + tojson(op));
});
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp
index f2b3b75b9dc..123a3deb18c 100644
--- a/src/mongo/db/index_builds_coordinator.cpp
+++ b/src/mongo/db/index_builds_coordinator.cpp
@@ -1325,6 +1325,7 @@ void IndexBuildsCoordinator::updateCurOpOpDescription(OperationContext* opCtx,
auto opDescObj = builder.obj();
curOp->setLogicalOp_inlock(LogicalOp::opCommand);
curOp->setOpDescription_inlock(opDescObj);
+ curOp->setNS_inlock(nss.ns());
curOp->ensureStarted();
}