[SERVER-38420] Mongos returns confusing error message if receives request with higher transaction number without 'startTransaction' Created: 05/Dec/18 Updated: 06/Dec/22 Resolved: 05/Dec/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Esha Maharishi (Inactive) | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Sharding
|
||||||||
| Participants: | |||||||||
| Description |
|
Based on this conversation in the driver's spec for pinning a transaction to a single mongos, I found that mongos returns NoSuchTransaction if the mongos receives a request for a transaction number different from the last transaction number it had heard but without 'startTransaction'. Perhaps this error message can be more clear? I had assumed the error would be something like "cannot start new transaction unless 'startTransaction' is specified." There's a TODO in the code without a SERVER ticket, so I'm just filing this ticket to go back to it. |
| Comments |
| Comment by Shane Harvey [ 05/Dec/18 ] | |||||||
|
For easier reference, the current confusing error message is:
Where "txnId -1" is what the server knows and "txnId 1" is the value the client sent ("txnNumber": 1). | |||||||
| Comment by Randolph Tan [ 05/Dec/18 ] | |||||||
|
esha.maharishi Yes, this for the case for retrying commit on a totally different mongos. Since commit doesn't have startTransaction and can be called on a mongos that doesn't have any knowledge about the transaction, it has to be handled differently. This will be taken care of as part of | |||||||
| Comment by Esha Maharishi (Inactive) [ 05/Dec/18 ] | |||||||
|
renctan, do you remember why there was a TODO there? |