summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2018-05-16 11:14:17 -0400
committerJudah Schvimer <judah@mongodb.com>2018-05-16 11:43:01 -0400
commite716867bb5c36f7ad4686cf020f5f35b9cd9636e (patch)
tree5975df5796fd18d84b3b61192d64170fa61b7a65
parente205726dd5ea4effac7466efc35a9eb52fdb618d (diff)
downloadmongo-e716867bb5c36f7ad4686cf020f5f35b9cd9636e.tar.gz
SERVER-32382 set a default rollback batch size
-rw-r--r--src/mongo/db/repl/bgsync.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index 3fe778d9909..7e5ff744acc 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -80,7 +80,10 @@ MONGO_EXPORT_STARTUP_SERVER_PARAMETER(bgSyncOplogFetcherBatchSize, int, defaultB
// The batchSize to use for the find/getMore queries called by the rollback common point resolver.
// A batchSize of 0 means that the 'find' and 'getMore' commands will be given no batchSize.
-constexpr int defaultRollbackBatchSize = 0;
+// We set the default to 2000 to prevent the sync source from having to read too much data at once,
+// and reduce the chance of a socket timeout.
+// We choose 2000 for (10 minute timeout) * (60 sec / min) * (50 MB / second) / (16 MB / document).
+constexpr int defaultRollbackBatchSize = 2000;
MONGO_EXPORT_SERVER_PARAMETER(rollbackRemoteOplogQueryBatchSize, int, defaultRollbackBatchSize)
->withValidator([](const auto& potentialNewValue) {
if (potentialNewValue < 0) {