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/ttl.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/ttl.cpp')
-rw-r--r-- | src/mongo/db/ttl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 9d533c2ea93..e680d6bd671 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -50,6 +50,7 @@ #include "mongo/db/index/index_descriptor.h" #include "mongo/db/operation_context_impl.h" #include "mongo/db/ops/insert.h" +#include "mongo/db/namespace_string.h" #include "mongo/db/query/internal_plans.h" #include "mongo/db/repl/replication_coordinator_global.h" #include "mongo/db/server_parameters.h" @@ -215,7 +216,8 @@ namespace mongo { */ bool doTTLForIndex(OperationContext* txn, const string& dbName, BSONObj idx) { const string ns = idx["ns"].String(); - if (!userAllowedWriteNS(ns).isOK()) { + NamespaceString nss(ns); + if (!userAllowedWriteNS(nss).isOK()) { error() << "namespace '" << ns << "' doesn't allow deletes, skipping ttl job for: " << idx; return true; @@ -251,7 +253,7 @@ namespace mongo { return true; } - if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(dbName)) { + if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesFor(nss)) { // We've stepped down since we started this function, so we should stop working // as we only do deletes on the primary. return false; |