summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-05-08 23:24:06 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2019-05-08 23:24:06 -0400
commitfb97757aed27a719ca48e0794f29006dec1a7dac (patch)
tree1e8b7c11f2f6abd5b6472e9a886294020ee9c13b /src/mongo/db
parent50ad28ae365ad63a83508d708cf2fc0b6f7fa161 (diff)
downloadmongo-fb97757aed27a719ca48e0794f29006dec1a7dac.tar.gz
Revert "SERVER-41006 Make replBatchLimitBytes configurable"
This reverts commit e0726e830cca9f4971722616eeb24b56321fe4b8.
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/repl/initial_syncer.cpp2
-rw-r--r--src/mongo/db/repl/oplog_applier.cpp2
-rw-r--r--src/mongo/db/repl/oplog_applier.h5
-rw-r--r--src/mongo/db/repl/repl_server_parameters.idl13
-rw-r--r--src/mongo/db/repl/sync_tail.cpp6
5 files changed, 10 insertions, 18 deletions
diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp
index e87bf3915c7..4733e69ea10 100644
--- a/src/mongo/db/repl/initial_syncer.cpp
+++ b/src/mongo/db/repl/initial_syncer.cpp
@@ -1685,7 +1685,7 @@ StatusWith<Operations> InitialSyncer::_getNextApplierBatch_inlock() {
// Obtain next batch of operations from OplogApplier.
auto opCtx = makeOpCtx();
OplogApplier::BatchLimits batchLimits;
- batchLimits.bytes = OplogApplier::calculateBatchLimitBytes(opCtx.get(), _storage);
+ batchLimits.bytes = OplogApplier::replBatchLimitBytes;
batchLimits.ops = OplogApplier::getBatchLimitOperations();
return _oplogApplier->getNextApplierBatch(opCtx.get(), batchLimits);
}
diff --git a/src/mongo/db/repl/oplog_applier.cpp b/src/mongo/db/repl/oplog_applier.cpp
index a44cb2ab410..7e6010aa77c 100644
--- a/src/mongo/db/repl/oplog_applier.cpp
+++ b/src/mongo/db/repl/oplog_applier.cpp
@@ -77,7 +77,7 @@ std::size_t OplogApplier::calculateBatchLimitBytes(OperationContext* opCtx,
auto oplogMaxSizeResult =
storageInterface->getOplogMaxSize(opCtx, NamespaceString::kRsOplogNamespace);
auto oplogMaxSize = fassert(40301, oplogMaxSizeResult);
- return std::min(oplogMaxSize / 10, std::size_t(replBatchLimitBytes.load()));
+ return std::min(oplogMaxSize / 10, std::size_t(replBatchLimitBytes));
}
OplogApplier::OplogApplier(executor::TaskExecutor* executor,
diff --git a/src/mongo/db/repl/oplog_applier.h b/src/mongo/db/repl/oplog_applier.h
index 0966ec3b960..49477ac03ec 100644
--- a/src/mongo/db/repl/oplog_applier.h
+++ b/src/mongo/db/repl/oplog_applier.h
@@ -104,6 +104,11 @@ public:
OperationContext* opCtx, const BatchLimits& batchLimits)>;
/**
+ * Lower bound of batch limit size (in bytes) returned by calculateBatchLimitBytes().
+ */
+ static const unsigned int replBatchLimitBytes = 100 * 1024 * 1024;
+
+ /**
* Creates thread pool for writer tasks.
*/
static std::unique_ptr<ThreadPool> makeWriterPool();
diff --git a/src/mongo/db/repl/repl_server_parameters.idl b/src/mongo/db/repl/repl_server_parameters.idl
index ba56ea21c4d..b7b2447649a 100644
--- a/src/mongo/db/repl/repl_server_parameters.idl
+++ b/src/mongo/db/repl/repl_server_parameters.idl
@@ -237,16 +237,3 @@ server_parameters:
lte:
expr: 1000 * 1000
- replBatchLimitBytes:
- description: The maximum oplog application batch size in bytes
- set_at: [ startup, runtime ]
- cpp_vartype: AtomicWord<int>
- cpp_varname: replBatchLimitBytes
- default:
- expr: 100 * 1024 * 1024
- validator:
- gte:
- expr: 16 * 1024 * 1024
- lte:
- expr: 100 * 1024 * 1024
-
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index 0b93b7d373b..a3dcb97e410 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -633,16 +633,16 @@ private:
Client::initThread("ReplBatcher");
BatchLimits batchLimits;
+ batchLimits.bytes = OplogApplier::calculateBatchLimitBytes(
+ cc().makeOperationContext().get(), _storageInterface);
while (true) {
MONGO_FAIL_POINT_PAUSE_WHILE_SET(rsSyncApplyStop);
batchLimits.slaveDelayLatestTimestamp = _calculateSlaveDelayLatestTimestamp();
- // Check the limits once per batch since users can change them at runtime.
+ // Check this once per batch since users can change it at runtime.
batchLimits.ops = OplogApplier::getBatchLimitOperations();
- batchLimits.bytes = OplogApplier::calculateBatchLimitBytes(
- cc().makeOperationContext().get(), _storageInterface);
OpQueue ops(batchLimits.ops);
{