summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/storage/SConscript1
-rw-r--r--src/mongo/db/storage/flow_control.cpp5
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;