[SERVER-55593] Iterating cursor fails when the shell is started with --apiVersion 1 Created: 29/Mar/21  Updated: 18/Apr/21  Resolved: 07/Apr/21

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Tomer Yakir Assignee: Samyukta Lanka
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-55891 Create apiVersion test suites Closed
is related to SERVER-49380 mongo shell changes for MongoDB Stabl... Closed
is related to SERVER-55614 Permit Versioned API options for getM... Closed
Operating System: ALL
Sprint: Repl 2021-04-05, Repl 2021-04-19
Participants:

 Description   

The following shell script:

for (var i=0; i<200;i++) {
   db.t.insert({a:1});
}
cur = db.t.find().limit(100).batchSize(10);
res = cur.toArray();

fails in "getMore" with:

"errmsg" : "Cannot pass in API parameter field apiVersion"



 Comments   
Comment by Samyukta Lanka [ 07/Apr/21 ]

Closing this since we are going to do SERVER-55614 instead, which will make us change the server behavior rather than the shell behavior.

I filed SERVER-55891 for Jesse's idea to add new test suites.

Comment by A. Jesse Jiryu Davis [ 29/Mar/21 ]

Probably a bug in my changes for SERVER-49380. The shell appears to include API params in getMore, which is prohibited. We should test this in api_version_parameters_shell.js. Same for API params in transaction-continuing commands, I bet I made the same mistake.

(This is a bug in the shell's implementation of the current protocol - andreas.braun is considering a change (SERVER-55614) to the protocol that would require getMore to include the same API params as the cursor-creating find/aggregate/etc. command. Same for transaction-continuing commands. If we make that protocol change in the server, the shell might be correct!)

I think api_version_parameters_shell.js doesn't give enough coverage. Consider making new test suites that start the shell with –apiVersion 1 and run jsCore (or something) against mongod and against mongos.

Generated at Thu Feb 08 05:36:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.