Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-332

Operations don't report errors for invalid setName in single topologies

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.0
    • 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.

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: