diff options
author | Benety Goh <benety@mongodb.com> | 2015-06-07 20:49:34 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2015-06-09 19:03:03 -0400 |
commit | 7a051310660319f3fc33b85722a206a11fa20309 (patch) | |
tree | c2ff91734c49ad08fad38ba345f2bb2f0823b2e0 /src/mongo/db/cloner.cpp | |
parent | 23628bdf724248a28bb73f6a1b647139ca09e465 (diff) | |
download | mongo-7a051310660319f3fc33b85722a206a11fa20309.tar.gz |
SERVER-18807 modified ReplicationCoordinator::canAcceptWritesForDatabases to accept a namespace instead of a database name
Diffstat (limited to 'src/mongo/db/cloner.cpp')
-rw-r--r-- | src/mongo/db/cloner.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index aaa53cccceb..52aa4babaa1 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -133,7 +133,7 @@ namespace mongo { str::stream() << "Not primary while cloning collection " << from_collection.ns() << " to " << to_collection.ns(), !txn->writesAreReplicated() || - repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(_dbName)); + repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(to_collection)); // Make sure database still exists after we resume from the temp release Database* db = dbHolder().openDb(txn, _dbName); @@ -182,10 +182,10 @@ namespace mongo { // Check if everything is still all right. if (txn->writesAreReplicated()) { uassert(28592, - str::stream() << "Cannot write to db: " << _dbName + str::stream() << "Cannot write to ns: " << to_collection.ns() << " after yielding", repl::getGlobalReplicationCoordinator()-> - canAcceptWritesForDatabase(_dbName)); + canAcceptWritesFor(to_collection)); } // TODO: SERVER-16598 abort if original db or collection is gone. @@ -283,7 +283,7 @@ namespace mongo { << " to " << to_collection.ns() << " with filter " << query.toString(), !txn->writesAreReplicated() || - repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(toDBName)); + repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(to_collection)); } void Cloner::copyIndexes(OperationContext* txn, @@ -314,7 +314,7 @@ namespace mongo { str::stream() << "Not primary while copying indexes from " << from_collection.ns() << " to " << to_collection.ns() << " (Cloner)", !txn->writesAreReplicated() || - repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(toDBName)); + repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(to_collection)); if (indexesToBuild.empty()) @@ -381,7 +381,7 @@ namespace mongo { uassert(ErrorCodes::NotMaster, str::stream() << "Not primary while copying collection " << ns << " (Cloner)", !txn->writesAreReplicated() || - repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(dbname)); + repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(nss)); Database* db = dbHolder().openDb(txn, dbname); |