-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Context
Currently, there's a bunch of logic that tries to pick which error to return after a failed retry. That logic frequently discards important error information and makes it difficult or impossible to troubleshoot problems without a bunch of additional event monitoring or logging enabled. It would be much more useful to collect all error information for all operation attempts and return them in one error, painting a much more complete picture of the history of a given operation in a single error value. To do that, we should use errutil.Join to join all errors that happen while attempting a given operation together.
Definition of done
- Join all operation errors together if the final retry does not succeed. Return the joined error.
- Join all errors that happen during transaction retries.
- Join all errors that happen during change stream retries.
Pitfalls
- We've never used errutil.Join before. It's possible there are unexpected behaviors created by that backward compatibility shim in Go 1.19 and older.
- We've never joined errors together. It's possible there will be unexpected error handling bugs introduced by returning joined errors.