summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Lerner <alerner@10gen.com>2013-04-09 12:49:06 -0400
committerAlberto Lerner <alerner@10gen.com>2013-04-09 12:51:21 -0400
commit6edf4a7f081a4d2dc7c515a29908b79af5e94771 (patch)
tree9bc3c803b3bd25ac718a97dab188780d7e776bf4
parent9f073b6cae48457c6adb81cf399694da7b6d85e7 (diff)
downloadmongo-6edf4a7f081a4d2dc7c515a29908b79af5e94771.tar.gz
SERVER-9125 Prevent cursor time out in the case of very slow config servers
-rw-r--r--src/mongo/s/config_upgrade_helpers.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/s/config_upgrade_helpers.cpp b/src/mongo/s/config_upgrade_helpers.cpp
index ab3b424a183..6495b5d9c80 100644
--- a/src/mongo/s/config_upgrade_helpers.cpp
+++ b/src/mongo/s/config_upgrade_helpers.cpp
@@ -262,8 +262,17 @@ namespace mongo {
try {
log() << "About to copy " << fromNS << " to " << toNS << endl;
+ // Lower the query's batchSize so that we incur in getMore()'s more frequently.
+ // The rationale here is that, if for some reason the config server is extremely
+ // slow, we wouldn't time this cursor out.
ScopedDbConnection& conn = *connPtr;
- scoped_ptr<DBClientCursor> cursor(_safeCursor(conn->query(fromNS, BSONObj())));
+ scoped_ptr<DBClientCursor> cursor(_safeCursor(conn->query(fromNS,
+ BSONObj(),
+ 0 /* nToReturn */,
+ 0 /* nToSkip */,
+ NULL /* fieldsToReturn */,
+ 0 /* queryOptions */,
+ 1024 /* batchSize */)));
vector<BSONObj> insertBatch;
int32_t insertSize = 0;