Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5088

ClusterSettings does not compute ClusterConnectionMode consistently

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 5.0.0
    • None
    • Configuration
    • None
    • Major Change
    • Needed
    • Hide

      Let's mention in What's new that we fixed the way ClusterConnectionMode is computed by ClusterSettings. ClusterSettings.getMode now consistently returns ClusterConnectionMode.MULTIPLE if the replica set name is configured, whether via ClusterSettings.Builder.applyConnectionString or via ClusterSettings.Builder. requiredReplicaSetName. Previously, this was happening only if the replica set name was configured via a connection string.

      Show
      Let's mention in What's new that we fixed the way ClusterConnectionMode is computed by ClusterSettings . ClusterSettings.getMode now consistently returns ClusterConnectionMode.MULTIPLE if the replica set name is configured, whether via ClusterSettings.Builder.applyConnectionString or via ClusterSettings.Builder. requiredReplicaSetName . Previously, this was happening only if the replica set name was configured via a connection string.

    Description

      The following code computes ClusterConnectionMode.MULTIPLE

      ClusterSettings.builder()
              .applyConnectionString(new ConnectionString("mongodb://127.0.0.1:27017/?replicaSet=replset"))
              .build()
              .getMode()
      

      but its direct counterpart that does not use applyConnectionString computes ClusterConnectionMode.SINGLE

      ClusterSettings.builder()
              .hosts(Collections.singletonList(
                      new ServerAddress("127.0.0.1", 27017)
              ))
              .requiredReplicaSetName("replset")
              .build()
              .getMode()
      

      Attachments

        Activity

          People

            valentin.kovalenko@mongodb.com Valentin Kavalenka
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: