diff options
author | Randolph Tan <randolph@10gen.com> | 2012-05-22 19:22:58 -0400 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2012-05-24 14:38:16 -0400 |
commit | b45a2ff6e0b1d91da406c52a328d9d9aea08be6b (patch) | |
tree | b6db78096cff109aced104d508652fa83a5db243 /src/mongo/s/strategy_shard.cpp | |
parent | a7be5e92b29cf21ccee24ab26fbdb8c76082eb2c (diff) | |
download | mongo-b45a2ff6e0b1d91da406c52a328d9d9aea08be6b.tar.gz |
SERVER-5844 mongos cursors return the wrong value for startingFrom
Diffstat (limited to 'src/mongo/s/strategy_shard.cpp')
-rw-r--r-- | src/mongo/s/strategy_shard.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/s/strategy_shard.cpp b/src/mongo/s/strategy_shard.cpp index a81f97a8214..c3d10f4a9b9 100644 --- a/src/mongo/s/strategy_shard.cpp +++ b/src/mongo/s/strategy_shard.cpp @@ -89,6 +89,7 @@ namespace mongo { BufBuilder buffer( ShardedClientCursor::INIT_REPLY_BUFFER_SIZE ); int docCount = 0; + const int startFrom = cc->getTotalSent(); bool hasMore = cc->sendNextBatch( r, q.ntoreturn, buffer, docCount ); if ( hasMore ) { @@ -97,7 +98,7 @@ namespace mongo { } replyToQuery( 0, r.p(), r.m(), buffer.buf(), buffer.len(), docCount, - cc->getTotalSent(), hasMore ? cc->getId() : 0 ); + startFrom, hasMore ? cc->getId() : 0 ); } else{ // TODO: Better merge this logic. We potentially can now use the same cursor logic for everything. @@ -154,6 +155,7 @@ namespace mongo { // TODO: Try to match logic of mongod, where on subsequent getMore() we pull lots more data? BufBuilder buffer( ShardedClientCursor::INIT_REPLY_BUFFER_SIZE ); int docCount = 0; + const int startFrom = cursor->getTotalSent(); bool hasMore = cursor->sendNextBatch( r, ntoreturn, buffer, docCount ); if ( hasMore ) { @@ -166,7 +168,7 @@ namespace mongo { } replyToQuery( 0, r.p(), r.m(), buffer.buf(), buffer.len(), docCount, - cursor->getTotalSent(), hasMore ? cursor->getId() : 0 ); + startFrom, hasMore ? cursor->getId() : 0 ); } } |