Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
Description
Detailed steps to reproduce the problem?
- Create a 2-shard cluster.
- Create a collection with 1 chunk on either cluster.
- Create failpoints on both clusters for the “update” command. Give either failpoint a different error code (e.g., 1 and 2).
- On the mongos, run updateMany({},
Unknown macro: { $set}
). The command will receive a MultipleErrorsOccurred value (code=65).
- In Go, HasErrorCode(2) on that error should return true if any of the component errors has error code 2.
The error structure is:
{
|
index: 0,
|
code: 65,
|
errInfo: {
|
causedBy: [
|
{
|
index: 0,
|
code: 1,
|
errmsg: "Failing command via 'failCommand' failpoint"
|
},
|
{
|
index: 0,
|
code: 2,
|
errmsg: "Failing command via 'failCommand' failpoint"
|
}
|
]
|
},
|
[Symbol(errorLabels)]: Set(0) {}
|
}
|
Example failpoint creation (note the `failInternalCommands` flag):
db.adminCommand({ configureFailPoint: "failCommand", mode: "alwaysOn", data: { errorCode:2, failCommands: ["update", 'find'], failInternalCommands:true} })
|
Definition of done: what must be done to consider the task complete?
HasErrorCode() should handle MultipleErrorsOccurred as it currently handles `WriteError`s.
The exact Go version used, with patch level:
1.20.11
The exact version of the Go driver used:
1.12.1
Describe how MongoDB is set up. Local vs Hosted, version, topology, load balanced, etc.
2-shard cluster; each shard has a single node.
The operating system and version (e.g. Windows 7, OSX 10.8, ...)
macOS
Security Vulnerabilities
n/a
Attachments
Issue Links
- depends on
-
DRIVERS-2775 Investigate optionally supporting parsing errInfo for MultipleErrorsOccurred
-
- Needs Triage
-
- is depended on by
-
GODRIVER-3086 Add a method to ServerError that returns all error codes.
-
- Blocked
-
- related to
-
GODRIVER-3086 Add a method to ServerError that returns all error codes.
-
- Blocked
-