[CDRIVER-3107] Warn when removing the last server from a topology Created: 30/Apr/19 Updated: 28/Oct/23 Resolved: 24/Jul/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.15.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Isabel Atkinson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Quoting SDAM: Other Topology Types:
Emitting a warning could better assist users in catching the following cases that could lead to an empty topology and non-functional application:
|
| Comments |
| Comment by Githook User [ 31/Jul/19 ] |
|
Author: {'name': 'isabelatkinson', 'username': 'isabelatkinson', 'email': 'isabel.atkinson@10gen.com'}Message: Emit a warning when the last server in the topology is removed in the |
| Comment by Githook User [ 24/Jul/19 ] |
|
Author: {'name': 'isabelatkinson', 'email': 'isabel.atkinson@10gen.com', 'username': 'isabelatkinson'}Message: Emit a warning when the last server in the topology is removed in the |
| Comment by Jeremy Mikola [ 02/Jul/19 ] |
By "typo", I meant that the value of the replicaSet URI option does not match the replica set of any hosts included in the seed list. As part of SDAM, the driver will end up removing each host from the topology as it realizes the name in its isMaster response does not match the URI option. I expect additional replica set members included in the isMaster response (but not in the seed list) also won't even be considered if the replica set name does not match. The end result in this case is that we end up with an empty topology. If you search for "setName" in the Actions section of the spec, you'll see the various steps where nodes may be removed. As a side note, the spec talks about optionally validating the set name for a single topology; however, I don't believe that applies to libmongoc. IIRC, the "replicaSet" URI option will cause libmongoc to consider the topology a replica set, even if there is only one node in the seed list (which would otherwise resemble a standalone connection string). |