[CDRIVER-4057] Reset setName when stale primary detected Created: 06/Jul/21  Updated: 15/Apr/22

Status: Backlog
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CDRIVER-4107

 Description   

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.


Generated at Wed Feb 07 21:19:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.