[CDRIVER-3256] SDAM "changed" events emitted even if descriptions don't change Created: 24/Jul/19 Updated: 28/Oct/23 Resolved: 12/Feb/20 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.17.0-beta, 1.17.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Kevin Albertson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
The SDAM monitoring spec states that the ServerDescriptionChangedEvent must be emitted...
And similarly, the TopologyDescriptionChangedEvent must be emitted...
Though, it does not appear that we check if the previous and new server descriptions differ when generating the events here Note the comparison for ServerDescription equality is described here. I've validated that we incorrectly send events with the attached modification to example-client.c, which prints out two SDAM ServerDescriptionChanged events with equal isMaster replies, and example output in curr/prev.json of two equivalent isMaster replies that were printed. |
| Comments |
| Comment by Githook User [ 12/Feb/20 ] |
|
Author: {'username': 'kevinAlbs', 'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com'}Message: |
| Comment by Githook User [ 14/Jan/20 ] |
|
Author: {'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}Message: Excluding one SDAM monitoring test, which is waiting on |
| Comment by Kevin Albertson [ 08/Jan/20 ] |
|
Note, libmongoc does not appear to have an implementation of the Server Description Equality matching (https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#server-description-equality), which makes me think we're also unnecessarily processing equal isMaster replies from non-single topologies. The SDAM spec says that when we're processing an isMaster reply for a non-single topology:
SPEC-1475 adds a spec test that for a single topology, repeated equal isMaster replies do not produce repeated server_description_changed or topology_description_changed events. Once this ticket is complete, sync that test as well (standalone_suppress_equal_description_changes.json). Perhaps also create a spec test for non-single topologies, since I don't believe standalone_suppress_equal_description_changes would have caught the issue that we were still processing equal isMaster on non-single topologies. |
| Comment by Githook User [ 25/Jul/19 ] |
|
Author: {'name': 'Kaitlin Mahar', 'email': 'kaitlinmahar@gmail.com', 'username': 'kmahar'}Message: add workaround for workaround for |
| Comment by Githook User [ 24/Jul/19 ] |
|
Author: {'name': 'Kaitlin Mahar', 'email': 'kaitlinmahar@gmail.com', 'username': 'kmahar'}Message: add workaround for workaround for |