summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index 8c72e2050ae..9ba85e79f9f 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -1535,7 +1535,7 @@ void mongo::execCommandDatabase(OperationContext* txn,
repl::ReplicationCoordinator* replCoord =
repl::ReplicationCoordinator::get(txn->getClient()->getServiceContext());
- const bool iAmPrimary = replCoord->canAcceptWritesForDatabase(dbname);
+ const bool iAmPrimary = replCoord->canAcceptWritesForDatabase_UNSAFE(txn, dbname);
{
bool commandCanRunOnSecondary = command->slaveOk();
@@ -1556,7 +1556,7 @@ void mongo::execCommandDatabase(OperationContext* txn,
if (!command->maintenanceOk() &&
replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet &&
- !replCoord->canAcceptWritesForDatabase(dbname) &&
+ !replCoord->canAcceptWritesForDatabase_UNSAFE(txn, dbname) &&
!replCoord->getMemberState().secondary()) {
uassert(ErrorCodes::NotMasterOrSecondary,