Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-795

Clarify behavior when "me" field doesn't match any values in "hosts" array

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • None

      In scope of SPEC-192, the SDAM spec was modified to say that a server that responds with a "me" field value that is different than the host/port that was used to connect to that server, the server should be removed from the topology (after adding all the values from the "hosts" field array value.

      The current belief is that this is still correct, but in scope of HELP-12962 we realized that our drivers are not consistent in their implementation, and it's affecting whether the "split horizons" feature in MongoDB 4.2 works with all of our drivers.

      In reviewing the spec tests from SPEC-192, it's clear that there is room for improvement to ensure consistency between drivers. Currently, all the server responses that we unit test are documents where the value of the "me" field matches one of the values in the "hosts" field array. We should add a test where they don't match, and assert what the expected outcome is.

      Something like this, perhaps:

      description: Secondary mismatched me (2)
      phases:
        - outcome:
            servers:
              'public2:27017':
                setName: null
                type: Unknown
            setName: rs
            topologyType: ReplicaSetNoPrimary
            logicalSessionTimeoutMinutes: null
          responses:
            - - 'public1:27017'
              - me: 'private1:27017'
                hosts:
                  - 'public1:27017'
                  - 'public2:27017'
                ismaster: false
                ok: 1
                setName: rs
                minWireVersion: 0
                maxWireVersion: 6
      uri: 'mongodb://public1:27017,public2:27017/?replicaSet=rs'
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: