summaryrefslogtreecommitdiff
path: root/src/mongo/db/db.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-07-03 17:23:47 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2018-07-23 15:24:13 -0400
commitdeb1161a6c3feb0497c9af4c7b72b01c6d4bdb97 (patch)
tree9ab730a53b8cab924cd173d476eea37c10c2965f /src/mongo/db/db.cpp
parent5e1b2d0af5b73d49fd51a1b11cc5e970a1abe773 (diff)
downloadmongo-deb1161a6c3feb0497c9af4c7b72b01c6d4bdb97.tar.gz
SERVER-34414 Create system indexes using the normal index creation and replication process.
Do not create them directly on secondaries. Do create oplog entries for index creation. (cherry picked from commit cfa75c933e125b41596c80b9a1297bb12d318ac3)
Diffstat (limited to 'src/mongo/db/db.cpp')
-rw-r--r--src/mongo/db/db.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index ab70e7ee56b..8e9e21573e2 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -879,6 +879,9 @@ ExitCode _initAndListen(int listenPort) {
log() << redact(status);
if (status == ErrorCodes::AuthSchemaIncompatible) {
exitCleanly(EXIT_NEED_UPGRADE);
+ } else if (status == ErrorCodes::NotMaster) {
+ // Try creating the indexes if we become master. If we do not become master,
+ // the master will create the indexes and we will replicate them.
} else {
quickExit(EXIT_FAILURE);
}