-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
According to the SDAM specification, when users specify a Single TopologyType (i.e. directConnection=true) and a set name, we need to verify that the setName we get from monitoring actually matches the provided set name when executing operations:
A client MAY allow the user to supply a setName with an initial TopologyType of Single. In this case, if the ServerDescription's setName is null or wrong, the client MUST throw an error on every operation.
The driver doesn't currently do this.
repro:
let client = Client::with_uri_str("mongodb://localhost:27017/?directConnection=true&replicaSet=wrong").await.unwrap(); client.list_database_names(None).await.expect_err("should fail!");
Thank you divjot.arora for reporting this.