[SERVER-52612] Can't use getMore or transaction-continuing commands when requireApiVersion parameter is true Created: 03/Nov/20 Updated: 29/Oct/23 Resolved: 30/Nov/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 4.7.0 |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
I start a 4.7.0 standalone mongod like:
If I don’t include apiVersion: "1" in the getMore command, I get the error:
and if I do include it I get:
According to spec the server should not accept api version in getMore commands:
so I expect the second error but not the first. |
| Comments |
| Comment by A. Jesse Jiryu Davis [ 18/May/21 ] | ||||||||||||||||||||||||||||||||||
|
Update: a few months later we reversed, getMore and transaction-continuing commands now require the same API params as the cursor/transaction-initiating command. | ||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 02/Dec/20 ] | ||||||||||||||||||||||||||||||||||
|
One more bug I found: commit/abortTransaction should ban API parameters such as apiVersion, because commit/abortTransaction are transaction-continuing commands and all transaction-continuing commands must ban API params. However, on mongos commitTransaction didn't. Fixed in a followup commit along with more testing. | ||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 02/Dec/20 ] | ||||||||||||||||||||||||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 30/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: | ||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 25/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
They do, I just recalled incorrectly that I had run the tests against a replica set. I can confirm now that most transaction spec tests fail when requireApiVersion is on. Good catch. Thanks! | ||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 25/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
Transaction-continuing commands seem to have the same problem. Run "mongo --nodb" and paste:
The last two commands should succeed, but on master #5f72078a both fail with "The apiVersion parameter is required, please configure your MongoClient's API version". This might be a testing gap. Do the the transaction spec tests cover transaction-continuing commands? | ||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 24/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
jesse definitely that should be tested, but iirc I ran all of our txn spec tests against a server configured this way, and they pass. | ||||||||||||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 24/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
I wonder if we made the same mistake with transaction-continuing commands. | ||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 04/Nov/20 ] | ||||||||||||||||||||||||||||||||||
|
Simple repro in the shell:
|