summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rs_sync.h
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-09-06 16:06:18 -0400
committerEric Milkie <milkie@10gen.com>2012-09-07 12:38:49 -0400
commit00f7df9fb484313af0e6091c83c4112cc1842aff (patch)
treef0a6174681d70042fe4b0b480a2484a1a6bbfcf8 /src/mongo/db/repl/rs_sync.h
parent736cfe4115bd96ae909612ab65f9d13eba6acbe3 (diff)
downloadmongo-00f7df9fb484313af0e6091c83c4112cc1842aff.tar.gz
SERVER-6816 cap the batch on the journal commit limit
Calling commitIfNeeded() in a local db lock is prohibited so I removed it. Instead, we will make the batch sizes smaller than the journal commit limit size to avoid DR102 messages.
Diffstat (limited to 'src/mongo/db/repl/rs_sync.h')
-rw-r--r--src/mongo/db/repl/rs_sync.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/repl/rs_sync.h b/src/mongo/db/repl/rs_sync.h
index f47538d9742..9298c0d387c 100644
--- a/src/mongo/db/repl/rs_sync.h
+++ b/src/mongo/db/repl/rs_sync.h
@@ -20,6 +20,7 @@
#include <vector>
#include "mongo/db/client.h"
+#include "mongo/db/dur.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/oplog.h"
#include "mongo/util/concurrency/thread_pool.h"
@@ -69,7 +70,9 @@ namespace replset {
void applyOpsToOplog(std::deque<BSONObj>* ops);
protected:
- static const unsigned int replBatchSizeBytes = 1024 * 1024 * 256 ;
+ // Cap the batches using the limit on journal commits.
+ // This works out to be 100 MB (64 bit) or 50 MB (32 bit)
+ static const unsigned int replBatchSizeBytes = dur::UncommittedBytesLimit;
// Prefetch and write a deque of operations, using the supplied function.
// Initial Sync and Sync Tail each use a different function.