summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/validate.cpp
diff options
context:
space:
mode:
authorShin Yee Tan <shinyee.tan@mongodb.com>2020-07-14 15:13:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-14 15:56:36 +0000
commit674b8eb2cf067ce3c6fff5e07dc65d4f7e37ea49 (patch)
tree736b583ba4db53ab48e0be965849a3ce8bcbc797 /src/mongo/db/commands/validate.cpp
parent51604da9f47a7d58a72cf58cbfb28c4a2340642e (diff)
downloadmongo-674b8eb2cf067ce3c6fff5e07dc65d4f7e37ea49.tar.gz
SERVER-49340 Add repair mode to validate for startup --repair
Diffstat (limited to 'src/mongo/db/commands/validate.cpp')
-rw-r--r--src/mongo/db/commands/validate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp
index 318cbfa421b..ab46736a080 100644
--- a/src/mongo/db/commands/validate.cpp
+++ b/src/mongo/db/commands/validate.cpp
@@ -189,8 +189,13 @@ public:
return CollectionValidation::ValidateMode::kForegroundFull;
return CollectionValidation::ValidateMode::kForeground;
}();
+
+ // External users cannot run validate with repair as there is no way yet for users to invoke
+ // it. It is only to be used by startup repair.
+ auto repairMode = CollectionValidation::RepairMode::kNone;
ValidateResults validateResults;
- Status status = CollectionValidation::validate(opCtx, nss, mode, &validateResults, &result);
+ Status status =
+ CollectionValidation::validate(opCtx, nss, mode, repairMode, &validateResults, &result);
if (!status.isOK()) {
return CommandHelpers::appendCommandStatusNoThrow(result, status);
}