-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Motivation
Several SDAM specification tests make assertions that the setName on a server description is unset if it is a stale primary is reset to the state Unknown.
The test runner currently does not assert anything about the setName if it is null in the outcome. In attempting to add the check as part of CDRIVER-4053, it started failing on several tests. The following is a sampling:
- equal_electionids.json
- new_primary_new_electionid.json
- null_election_id.json
- setversion_without_electionid.json
- new_primary.json
- new_primary_new_setversion.json
I suspect the correct behavior, as the test asserts, is to reset the setName when a stale primary is detected.
I think this is low impact currently. I do not think this interferes with SDAM correctness. But it may be an inconsistency with other drivers. Users may incorrectly see a set setName in a ServerChangedEvent.
Scope
1. Investigate the root cause of these failures.
2. If, as suspected, the correct behavior is to reset the setName, make the fix (_mongoc_topology_description_invalidate_primaries_cb may be a starting point).
3. Add the assertion back in to test-mongoc-sdam.c.