diff options
author | Benety Goh <benety@mongodb.com> | 2020-03-27 18:00:31 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-27 22:17:36 +0000 |
commit | 86daed7acfc1a2adf97bf7d7b2ae009d7b52df24 (patch) | |
tree | bacc671cb158ccb06b8cdeb271b06f7392b58abc | |
parent | 2c6f128b7d29b852ddd9fe951da21280d4c6886b (diff) | |
download | mongo-86daed7acfc1a2adf97bf7d7b2ae009d7b52df24.tar.gz |
SERVER-46621 set ns field in currentOp for index builds
-rw-r--r-- | jstests/noPassthrough/indexbg_killop_primary.js | 2 | ||||
-rw-r--r-- | jstests/noPassthrough/indexbg_killop_secondary.js | 2 | ||||
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 1 |
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(); } |