[SERVER-48151] fix RSM erase in SingleServerIsMasterMonitor and ServerPingMonitor onTopologyChanged method Created: 12/May/20 Updated: 29/Oct/23 Resolved: 18/May/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.0-rc5 |
| Fix Version/s: | 4.4.0-rc7, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Lamont Nelson | Assignee: | Lamont Nelson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
non-deterministic parameter evaluation causes the erased range to be empty. use std::next for the end of the range. |
| Comments |
| Comment by Githook User [ 14/May/20 ] |
|
Author: {'name': 'Lamont Nelson', 'email': 'lamont.nelson@mongodb.com', 'username': 'lamontnelson'}Message: (cherry picked from commit 32ea52bbf377db1bf822276a80cd35af05289239) |
| Comment by Githook User [ 13/May/20 ] |
|
Author: {'name': 'Lamont Nelson', 'email': 'lamont.nelson@mongodb.com', 'username': 'lamontnelson'}Message: |
| Comment by Lamont Nelson [ 12/May/20 ] |
|
For future reference, when a server is removed from being monitored the monitor instance for the server is shutdown via a call here, which puts it into a state where no more events will be generated. Since the erase was sometimes wrong due to non-deterministic parameter evaluation order, when the RSM tries to add that server again it sees that there was already an instance there and omits creating a new one. This causes the server never to be re-added to the topology since there are no ismaster replies to process. The fix is simple, but since the bug was easy to overlook I kept the invariant checking the removal. |
| Comment by Lamont Nelson [ 12/May/20 ] |