[SERVER-68554] For a find request with batchSize equal to the limit size, the mongos of the sharded cluster will return a cursorid not equal to 0, the client will send an extra getMore, and no data is returned Created: 04/Aug/22 Updated: 05/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Chao Yin | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Participants: |
| Description |
|
For a sharded cluster, when a find request with a limit equal to batchSize is sent to mongos, the returned cursorid is not 0, like this:
Then the client will send a getMore request, but get empty data.
|
| Comments |
| Comment by Steve Tarzia [ 20/Sep/22 ] |
|
1321280378feng@gmail.com thank you for bringing this to our attention and for making an attempt to fix it. A few of our senior engineers reviewed your PR and we noticed a few deficiencies. For example, it only addresses the sharded case (not standalone collections) and there is no testing. I will put this on the backlog for us to consider later. We don't see this ticket as high priority because it is asking for a minor performance improvement and addressing it would likely complicate our codebase. |
| Comment by Chao Yin [ 18/Aug/22 ] |
|
Thanks for the quick reply! I've signed the Contributor Agreement. |
| Comment by Chris Kelly [ 17/Aug/22 ] |
|
Thanks for making this pull request! We just need you to sign our Contributor Agreement as part of our considering the PR. |
| Comment by Chao Yin [ 17/Aug/22 ] |
|
I create a PullRequest: https://github.com/mongodb/mongo/pull/1482. |
| Comment by Eric Sedor [ 11/Aug/22 ] |
|
Thanks 1321280378feng@gmail.com, I can indeed see that the cursor.id in the find command response is populated given db.runCommand({find:"coll", limit:1, batchSize:1}) but is 0 given db.runCommand({find:"coll", limit:1}). I'll pass this on to an appropriate team to consider. |