summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/collection_to_capped.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2015-06-07 20:49:34 -0400
committerBenety Goh <benety@mongodb.com>2015-06-09 19:03:03 -0400
commit7a051310660319f3fc33b85722a206a11fa20309 (patch)
treec2ff91734c49ad08fad38ba345f2bb2f0823b2e0 /src/mongo/db/commands/collection_to_capped.cpp
parent23628bdf724248a28bb73f6a1b647139ca09e465 (diff)
downloadmongo-7a051310660319f3fc33b85722a206a11fa20309.tar.gz
SERVER-18807 modified ReplicationCoordinator::canAcceptWritesForDatabases to accept a namespace instead of a database name
Diffstat (limited to 'src/mongo/db/commands/collection_to_capped.cpp')
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index 772c1682e37..2ee13ed04ca 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -96,7 +96,8 @@ namespace mongo {
ScopedTransaction transaction(txn, MODE_IX);
AutoGetDb autoDb(txn, dbname, MODE_X);
- if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(dbname)) {
+ NamespaceString nss(dbname, to);
+ if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(nss)) {
return appendCommandStatus(result, Status(ErrorCodes::NotMaster, str::stream()
<< "Not primary while cloning collection " << from << " to " << to
<< " (as capped)"));