summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authormathisbessamdb <mathis.bessa@mongodb.com>2022-10-31 19:58:44 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-31 21:31:27 +0000
commit8eccc479d9f5427fa369e1c1b473303411bdb78f (patch)
tree4b45121c346f9e24af9f6b9c2d7cf53051f808b5 /src/mongo/db/commands
parentb24674ac240b1cd713662a24996fae11f3afb8ad (diff)
downloadmongo-8eccc479d9f5427fa369e1c1b473303411bdb78f.tar.gz
SERVER-70411 Serialize and deserialize DbCheckOplogBatch correctly
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/dbcheck.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mongo/db/commands/dbcheck.cpp b/src/mongo/db/commands/dbcheck.cpp
index 1b1110abb29..166ee91e097 100644
--- a/src/mongo/db/commands/dbcheck.cpp
+++ b/src/mongo/db/commands/dbcheck.cpp
@@ -65,9 +65,8 @@ repl::OpTime _logOp(OperationContext* opCtx,
repl::MutableOplogEntry oplogEntry;
oplogEntry.setOpType(repl::OpTypeEnum::kCommand);
oplogEntry.setNss(nss);
- if (uuid) {
- oplogEntry.setUuid(*uuid);
- }
+ oplogEntry.setTid(nss.tenantId());
+ oplogEntry.setUuid(uuid);
oplogEntry.setObject(obj);
AutoGetOplog oplogWrite(opCtx, OplogAccessMode::kWrite);
return writeConflictRetry(
@@ -241,7 +240,8 @@ std::unique_ptr<DbCheckRun> getRun(OperationContext* opCtx,
// Get rid of generic command fields.
for (const auto& elem : obj) {
- if (!isGenericArgument(elem.fieldNameStringData())) {
+ const auto& fieldName = elem.fieldNameStringData();
+ if (!isGenericArgument(fieldName)) {
builder.append(elem);
}
}
@@ -251,11 +251,17 @@ std::unique_ptr<DbCheckRun> getRun(OperationContext* opCtx,
// If the dbCheck argument is a string, this is the per-collection form.
if (toParse["dbCheck"].type() == BSONType::String) {
return singleCollectionRun(
- opCtx, dbName, DbCheckSingleInvocation::parse(IDLParserContext(""), toParse));
+ opCtx,
+ dbName,
+ DbCheckSingleInvocation::parse(
+ IDLParserContext("", false /*apiStrict*/, dbName.tenantId()), toParse));
} else {
// Otherwise, it's the database-wide form.
return fullDatabaseRun(
- opCtx, dbName, DbCheckAllInvocation::parse(IDLParserContext(""), toParse));
+ opCtx,
+ dbName,
+ DbCheckAllInvocation::parse(
+ IDLParserContext("", false /*apiStrict*/, dbName.tenantId()), toParse));
}
}