[SERVER-37292] MovePrimarySourceManager can throw unhandled exception in a scope guard Created: 24/Sep/18 Updated: 06/Dec/22 Resolved: 06/Mar/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jack Mulrow | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Sharding
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The MovePrimarySourceManager calls cleanupOnError in a ScopeGuard in a few places, and in this method it wraps a call to ShardingCatalogCatalogClientImpl::logChange with uassertStatusOK inside a try catch statement that only catches NotMaster errors. If the CSRS is unreachable, the log could fail with an error other than NotMaster (like a network or read preference error), which would lead to std::terminate. |
| Comments |
| Comment by Gregory McKeon (Inactive) [ 06/Mar/19 ] |
|
As a result of https://github.com/mongodb/mongo/commit/9cf00022b936cdb3c2234235d5aaa6be7ef6146a, the logging of the error message as part of cleanup will no longer throw an exception if the write to the config server fails. |