Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update server description when equal #2256

Closed
wants to merge 50 commits into from

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Mar 9, 2020

Description

NODE-2474 - Server_Description update with lastUpdateTime / lastWriteDate fields is ignored in topology

The SDAM spec says:

Each time the client checks a server, it MUST replace its description of that server with a new one. This replacement MUST happen even if the new server description compares equal to the previous one, in order to keep client-tracked attributes like last update time and round trip time up to date.

This PR ensures the server description is updated even when equal.

What changed?

Are there any files to ignore?

The work here encompasses changes to the retryable writes logic of
the driver, such that the `RetryableWriteError` label becomes the
primary means of determining whether an operation will be retried.
4.4+ servers will attach this label server-side, so this change
allows us to gracefully remove client-side checking of retryable
write errors.

NODE-2379
We currently have an expectation that sharded tests are run against
a single mongos, but the driver does not correctly discover that a
single host passed in is a mongos or not. The only way to do this
currently is by specifying the host multiple times. A side effect
of this is that we need to deduplicate the seedlist in the legacy
Mongos topology type
A change to use the `RetryableWriteError` label to determine if
a write should be retried ignored that non-MongoError's could also
be caught. These should be ignored for the purposes of retryability
MongoDB 4.4+ will support removing an extra unnecessary empty
exchange during SCRAM handshaking

NODE-2301
Test operations until now have been built dynamically based on key
checking on the arguments object passed in. This approach works
but is very brittle. This commit introduces a new way of resolving
the test operation through a more formal specification that all
operations will eventually be migrated to.
mbroadst and others added 18 commits February 13, 2020 09:30
Code for tracking the `maxElectionId` currently assumes that the
id is represented in extended JSON. This fix modifies the test
runner to parse the extended JSON into BSON, and modified the
comparison logic to assume ObjectId

NODE-2464
There is no longer any topology type other than the unified topology,
so we default to it in the `connect` operation, and remove all tests
that don't work with it.
This is mostly moving files around to improve maintainability of
the codebase. The `core` package is completely removed, as well as
all dead code in the codebase.

NODE-2485
Now that the unified topology is the only topology, there is no
need to test it as a special configuration. Additionally, this
removes support for < Node Carbon.
@emadum emadum requested review from mbroadst and reggi March 9, 2020 20:01
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pull in the spec tests introduced here: mongodb/specifications@5d5946e. They will verify the fix is in.

@emadum
Copy link
Contributor Author

emadum commented Mar 10, 2020

I added the test and verified,

Before:

  1 failing

  1) Server Discovery and Monitoring (spec)
       rs
         Repeated ismaster response must be processed:

      AssertionError: expected {} to contain key 'c:27017'
      + expected - actual

       [
      -  "a:27017"
      -  "b:27017"
      +  "c:27017"
       ]

After:
✓ Repeated ismaster response must be processed

@emadum emadum requested a review from mbroadst March 10, 2020 15:29
@emadum emadum changed the base branch from master to 3.5 March 10, 2020 21:05
@emadum
Copy link
Contributor Author

emadum commented Mar 10, 2020

Accidentally branched off master, fixed PR here:

#2260

@emadum emadum closed this Mar 10, 2020
@emadum emadum deleted the NODE-2474/update-equal-server-description branch April 23, 2020 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants