diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2019-03-28 09:01:10 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2019-03-28 09:01:10 -0400 |
commit | f2f422d92b639edba0a10d40a43803723cb15baf (patch) | |
tree | c2f04f919385aa87163c18de336dc1741d8c0a49 /src | |
parent | cf14abb8e454edc042d5f4ad1768f19321135a79 (diff) | |
download | mongo-f2f422d92b639edba0a10d40a43803723cb15baf.tar.gz |
SERVER-39667: Locally disable flow control when majority reads are off.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/storage/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/storage/flow_control.cpp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/storage/SConscript b/src/mongo/db/storage/SConscript index b0992b3bcbb..f0b040be16c 100644 --- a/src/mongo/db/storage/SConscript +++ b/src/mongo/db/storage/SConscript @@ -371,6 +371,7 @@ env.Library( '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/concurrency/flow_control_ticketholder', '$BUILD_DIR/mongo/db/concurrency/lock_manager', + '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/db/service_context', '$BUILD_DIR/mongo/idl/server_parameter', '$BUILD_DIR/mongo/util/background_job', diff --git a/src/mongo/db/storage/flow_control.cpp b/src/mongo/db/storage/flow_control.cpp index f554cf8314f..ab5669fa8b0 100644 --- a/src/mongo/db/storage/flow_control.cpp +++ b/src/mongo/db/storage/flow_control.cpp @@ -40,6 +40,7 @@ #include "mongo/db/concurrency/lock_manager_defs.h" #include "mongo/db/repl/member_data.h" #include "mongo/db/repl/replication_coordinator.h" +#include "mongo/db/server_options.h" #include "mongo/db/storage/flow_control_parameters_gen.h" #include "mongo/util/background.h" #include "mongo/util/log.h" @@ -121,7 +122,7 @@ BSONObj FlowControl::generateSection(OperationContext* opCtx, int FlowControl::getNumTickets() { const int maxTickets = 1000 * 1000 * 1000; - if (!gFlowControlEnabled) { + if (serverGlobalParams.enableMajorityReadConcern == false || gFlowControlEnabled == false) { return maxTickets; } @@ -238,7 +239,7 @@ std::int64_t FlowControl::_approximateOpsBetween(std::uint64_t prevTs, std::uint } void FlowControl::sample(Timestamp timestamp, std::uint64_t opsApplied) { - if (!gFlowControlEnabled) { + if (serverGlobalParams.enableMajorityReadConcern == false || gFlowControlEnabled == false) { // TODO SERVER-39616: Remove this feature flag such that flow control can be turned on/off // at runtime. return; |