summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/dbcheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/dbcheck.cpp')
-rw-r--r--src/mongo/db/repl/dbcheck.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/repl/dbcheck.cpp b/src/mongo/db/repl/dbcheck.cpp
index 289b831b795..b1d4bf2f84f 100644
--- a/src/mongo/db/repl/dbcheck.cpp
+++ b/src/mongo/db/repl/dbcheck.cpp
@@ -509,27 +509,28 @@ Status dbCheckDatabaseOnSecondary(OperationContext* opCtx,
namespace repl {
/*
- * The corresponding command run on the secondary.
+ * The corresponding command run during command application.
*/
Status dbCheckOplogCommand(OperationContext* opCtx,
- const char* ns,
- const BSONElement& ui,
- BSONObj& cmd,
- const repl::OpTime& optime,
const repl::OplogEntry& entry,
OplogApplication::Mode mode,
boost::optional<Timestamp> stableTimestampForRecovery) {
+ const auto& cmd = entry.getObject();
+ OpTime opTime;
+ if (!opCtx->writesAreReplicated()) {
+ opTime = entry.getOpTime();
+ }
auto type = OplogEntries_parse(IDLParserErrorContext("type"), cmd.getStringField("type"));
IDLParserErrorContext ctx("o");
switch (type) {
case OplogEntriesEnum::Batch: {
auto invocation = DbCheckOplogBatch::parse(ctx, cmd);
- return dbCheckBatchOnSecondary(opCtx, optime, invocation);
+ return dbCheckBatchOnSecondary(opCtx, opTime, invocation);
}
case OplogEntriesEnum::Collection: {
auto invocation = DbCheckOplogCollection::parse(ctx, cmd);
- return dbCheckDatabaseOnSecondary(opCtx, optime, invocation);
+ return dbCheckDatabaseOnSecondary(opCtx, opTime, invocation);
}
}