Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
0
Description
_mutex should be locked before reading _canAcceptNonLocalWrites.
bool ReplicationCoordinatorImpl::canAcceptWritesForDatabase(StringData dbName) { |
// _canAcceptNonLocalWrites is always true for standalone nodes, always false for nodes |
// started with --slave, and adjusted based on primary+drain state in replica sets. |
// |
// That is, stand-alone nodes, non-slave nodes and drained replica set primaries can always |
// accept writes. Similarly, writes are always permitted to the "local" database. Finally, |
// in the event that a node is started with --slave and --master, we allow writes unless the |
// master/slave system has set the replAllDead flag. |
if (_canAcceptNonLocalWrites) { |
return true; |
}
|
if (dbName == kLocalDB) { |
return true; |
}
|
return !replAllDead && _settings.isMaster(); |
}
|
Attachments
Issue Links
- duplicates
-
SERVER-27892 Clarify locking rules for _canAcceptNonLocalWrites and _canServeNonLocalReads
-
- Closed
-