[GODRIVER-2672] Comprehensively checking for transaction error labels is not possible Created: 05/Dec/22 Updated: 28/Oct/23 Resolved: 31/Mar/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.11.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Qingyang Hu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||||||||||
| Description |
SummaryPer the transactions spec:
The Go Driver does not explicitly add these labels to server selection timeouts or provide an easy way for an application to check that a given error has these labels. Currently, the only function exposed for checking error labels is mongo.ServerError#HasErrorLabel, but that doesn't work for this case as server selection errors are not covered by the mongo.ServerError interface. The only workaround for applications is to manually check for *topology.ServerSelectionError, which is not ideal given that this type is under the "x" API. Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).This issue is present in v1.11.0, which is the latest released version at the time of writing. It can be reproduced against any server version/topology that supports transactions (4.0+ replicasets, 4.2+ sharded clusters). How to ReproduceSpin up a single node replicaset on localhost:27017 with any MongoDB version 4.0 or higher and run this example code. Note that the code explicitly shuts down the server, so the node must be restarted before each invocation. Additional Background |
| Comments |
| Comment by Githook User [ 04/Apr/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |
| Comment by Githook User [ 31/Mar/23 ] |
|
Author: {'name': 'Qingyang Hu', 'email': '103950869+qingyang-hu@users.noreply.github.com', 'username': 'qingyang-hu'}Message: |
| Comment by Matt Dale [ 05/Dec/22 ] |
|
This may be significantly simpler to implement once GODRIVER-2579 is done. |