[DRIVERS-795] Clarify behavior when "me" field doesn't match any values in "hosts" array Created: 21/Jan/20  Updated: 02/Mar/21

Status: Implementing
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-3501 Clarify behavior when "me" field does... Backlog
depends on CXX-1914 Clarify behavior when "me" field does... Backlog
depends on PHPC-1537 Clarify behavior when "me" field does... Blocked
depends on CSHARP-2912 Clarify behavior when "me" field does... Closed
depends on GODRIVER-1472 Clarify behavior when "me" field does... Closed
depends on JAVA-3602 Clarify behavior when "me" field does... Closed
depends on MOTOR-494 Clarify behavior when "me" field does... Closed
depends on NODE-2432 Clarify behavior when "me" field does... Closed
depends on PYTHON-2106 Clarify behavior when "me" field does... Closed
depends on RUBY-2099 Clarify behavior when "me" field does... Closed
Driver Compliance:
Key Status/Resolution FixVersion
PYTHON-2106 Works as Designed
NODE-2432 Fixed 3.6.0, 4.0.0
MOTOR-494 Works as Designed
CSHARP-2912 Fixed 2.11.0
CDRIVER-3501 Backlog
PHPC-1537 Blocked
GODRIVER-1472 Fixed 1.5.0
RUBY-2099 Fixed 2.12.0.rc0
CXX-1914 Backlog
JAVA-3602 Fixed 4.1.0

 Description   

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'


Generated at Thu Feb 08 08:22:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.