diff options
author | Alberto Lerner <alerner@10gen.com> | 2013-04-09 12:49:06 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2013-04-09 12:51:21 -0400 |
commit | 6edf4a7f081a4d2dc7c515a29908b79af5e94771 (patch) | |
tree | 9bc3c803b3bd25ac718a97dab188780d7e776bf4 | |
parent | 9f073b6cae48457c6adb81cf399694da7b6d85e7 (diff) | |
download | mongo-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.cpp | 11 |
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; |