summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Graetzer <simon.gratzer@mongodb.com>2021-06-09 09:39:11 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-10 11:20:20 +0000
commit1f64bbda633458a045efbb4fc32a2d52412a3942 (patch)
tree0076608b7d32027ff954bd03f72335629ec3e498
parent0b8ac00f8d05b42aa70614114b3cafa29e02b4bd (diff)
downloadmongo-1f64bbda633458a045efbb4fc32a2d52412a3942.tar.gz
SERVER-57433 Report rename collection parameters in currentOp
-rw-r--r--jstests/sharding/ddl_ops_reported_on_current_op_command.js10
-rw-r--r--src/mongo/db/s/create_collection_coordinator.cpp2
-rw-r--r--src/mongo/db/s/rename_collection_coordinator.cpp3
3 files changed, 8 insertions, 7 deletions
diff --git a/jstests/sharding/ddl_ops_reported_on_current_op_command.js b/jstests/sharding/ddl_ops_reported_on_current_op_command.js
index 1e12ea06bff..97f6e31803a 100644
--- a/jstests/sharding/ddl_ops_reported_on_current_op_command.js
+++ b/jstests/sharding/ddl_ops_reported_on_current_op_command.js
@@ -56,9 +56,8 @@ let getCurrentOpOfDDL = (ddlOpThread, desc) => {
assert.eq(nss, currOp[0].ns);
// It must have at least the shardKey.
assert(currOp[0].hasOwnProperty('command'));
- assert(currOp[0].command.hasOwnProperty('request'));
- assert(currOp[0].command.request.hasOwnProperty('shardKey'));
- assert.eq(shardKey, currOp[0].command.request.shardKey);
+ assert(currOp[0].command.hasOwnProperty('shardKey'));
+ assert.eq(shardKey, currOp[0].command.shardKey);
}
{
@@ -74,9 +73,10 @@ let getCurrentOpOfDDL = (ddlOpThread, desc) => {
// There must be one operation running with the appropiate ns.
assert.eq(1, currOp.length);
assert.eq(nss, currOp[0].ns);
+
// It must have the target collection.
- assert(currOp[0].hasOwnProperty('to'));
- assert.eq(toNss, currOp[0].to);
+ assert(currOp[0].hasOwnProperty('command'));
+ assert.docEq({to: toNss, dropTarget: true, stayTemp: false}, currOp[0].command);
}
{
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp
index 3dd8863055a..388366a8632 100644
--- a/src/mongo/db/s/create_collection_coordinator.cpp
+++ b/src/mongo/db/s/create_collection_coordinator.cpp
@@ -332,7 +332,7 @@ boost::optional<BSONObj> CreateCollectionCoordinator::reportForCurrentOp(
if (const auto& optComment = getForwardableOpMetadata().getComment()) {
cmdBob.append(optComment.get().firstElement());
}
- cmdBob.append("request", _doc.getCreateCollectionRequest().toBSON());
+ cmdBob.appendElements(_doc.getCreateCollectionRequest().toBSON());
BSONObjBuilder bob;
bob.append("type", "op");
diff --git a/src/mongo/db/s/rename_collection_coordinator.cpp b/src/mongo/db/s/rename_collection_coordinator.cpp
index 83add06607f..08168994c1e 100644
--- a/src/mongo/db/s/rename_collection_coordinator.cpp
+++ b/src/mongo/db/s/rename_collection_coordinator.cpp
@@ -106,12 +106,13 @@ boost::optional<BSONObj> RenameCollectionCoordinator::reportForCurrentOp(
if (const auto& optComment = getForwardableOpMetadata().getComment()) {
cmdBob.append(optComment.get().firstElement());
}
+ cmdBob.appendElements(_doc.getRenameCollectionRequest().toBSON());
+
BSONObjBuilder bob;
bob.append("type", "op");
bob.append("desc", "RenameCollectionCoordinator");
bob.append("op", "command");
bob.append("ns", nss().toString());
- bob.append("to", _doc.getTo().toString());
bob.append("command", cmdBob.obj());
bob.append("currentPhase", _doc.getPhase());
bob.append("active", true);