0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 07:59:02 +01:00

SERVER-17671 Clone admin database first during initial sync, to catch auth errors are early.

This commit is contained in:
Andy Schwerin 2015-03-20 16:40:06 -04:00
parent 2a06bcb8e4
commit bd03079b0f

View File

@ -311,6 +311,13 @@ namespace {
log() << "initial sync clone all databases";
list<string> dbs = r.conn()->getDatabaseNames();
{
// Clone admin database first, to catch schema errors.
list<string>::iterator admin = std::find(dbs.begin(), dbs.end(), "admin");
if (admin != dbs.end()) {
dbs.splice(dbs.begin(), dbs, admin);
}
}
Cloner cloner;
if (!_initialSyncClone(&txn, cloner, r.conn()->getServerAddress(), dbs, true)) {