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

COMPASS-3943: Update to latest node driver 3.3.4 #1834

Merged
merged 6 commits into from
Nov 13, 2019
Merged

Conversation

imlucas
Copy link
Contributor

@imlucas imlucas commented Oct 28, 2019

Description

This PR updates the node.js driver from 3.3.2 to the latest release 3.3.4. It contains many improvements and bug fixes. The full changelog is below.

Changelog Highlights

High Priority SDAM Fixes

NODE-2274 "Unified topology never regains nodes which temporarily go down"

Fixes the underlying cause of timeout-related errors such as "Server selection timed out" with more details in COMPASS-3849 COMPASS-3728. The pull request mongodb/node-mongodb-native#2197 contains much more context on the fix, and a new design document includes how and why the node.js driver team chose this architecture and future improvements it will enable.

Fix unsafe Buffer usage

connect: Switch new Buffer(size) -> Buffer.alloc(size) (da90c3a)

Removes the last unsafe buffer usage warning from the devtools console/terminal output when using or developing Compass. Rejoice!

Update from an Aggregation Pipeline

Update: add the ability to specify a pipeline to an update command (#2017) (44a4110)

While it has yet to come up, it is worth noting for the future that Compass can now technically add support for updates in aggregation pipeline stages which are new in MongoDB 4.2.

sdam_viz

sdam_viz: add new tool for visualizing driver sdam changes (738189a)

An internal tool for debugging SDAM (Server Discovery and Monitoring) that could be used as a base for a more productive connection debugging feature in Compass or merely adding to data-service debug logs.

mongodb-core "deprecation"

The mongodb-core dependency has been removed from mongodb-data-service because it has been moved back into the driver codebase as of [email protected]. mongodb-core will be officially deprecated in the future by the driver team.

node.js driver changelog

Diff v3.3.2...v3.3.4

3.3.4 (2019-11-11)

Bug Fixes

  • close: the unified topology emits a close event on close now (ee0db01)
  • connect: prevent multiple callbacks in error scenarios (5f6a787)
  • monitoring: incorrect states used to determine rescheduling (ec1e04c)
  • pool: don't reset a pool if we'not already connected (32316e4)
  • pool: only transition to DISCONNECTED if reconnect enabled (43d461e)
  • replset: don't leak servers failing to connect (f209160)
  • replset: use correct topologyId for event emission (19549ff)
  • sdam: minHeartbeatIntervalMS => minHeartbeatFrequencyMS (af9fb45)
  • sdam: don't emit close every time a child server closes (818055a)
  • sdam: don't lose servers when they fail monitoring (8a534bb)
  • sdam: don't remove unknown servers in topology updates (1147ebf)
  • sdam: ignore server errors when closing/closed (49d7235)
  • server: don't emit error in connect if closing/closed (62ada2a)
  • server: ensure state is transitioned to closed on connect fail (a471707)
  • topology: report unified topology as nodejs (d126665)
  • topology: set max listeners to infinity for db event relay (edb1335)

Features

  • sdam_viz: add new tool for visualizing driver sdam changes (738189a)
  • sdam_viz: support legacy topologies in sdam_viz tool (1a5537e)
  • update-hints: add support for hint to all update methods (720f5e5)

3.3.3 (2019-10-16)

Bug Fixes

  • change_stream: emit 'close' event if reconnecting failed (f24c084)
  • ChangeStream: remove startAtOperationTime once we have resumeToken (362afd8)
  • connect: Switch new Buffer(size) -> Buffer.alloc(size) (da90c3a)
  • MongoClient: only check own properties for valid options (9cde4b9)
  • mongos: disconnect proxies which are not mongos instances (ee53983)
  • mongos: force close servers during reconnect flow (186263f)
  • monitoring: correct spelling mistake for heartbeat event (21aa117)
  • replset: correct server leak on initial connect (da39d1e)
  • replset: destroy primary before removing from replsetstate (45ac09a)
  • replset: destroy servers that are removed during SDAM flow (9ea0190)
  • saslprep: add in missing saslprep dependency (41f1165)
  • topology: don't early abort server selection on network errors (2b6a359)
  • topology: don't emit server closed event on network error (194dcf0)
  • topology: include all BSON types in ctor for bson-ext support (aa4c832)
  • topology: respect the force parameter for topology close (d6e8936)

Features

  • Update: add the ability to specify a pipeline to an update command (#2017) (44a4110)
  • urlParser: default useNewUrlParser to true (52d76e3)

Motivation and Context

  • Dependency update

Update core to [email protected] and a patch release of data-service to use the same.

Types of changes

  • Patch (non-breaking change which fixes an issue)

@imlucas imlucas changed the title chore: update to node [email protected] COMPASS-3943: chore: update to latest data-service and node driver Oct 28, 2019
@imlucas imlucas changed the title COMPASS-3943: chore: update to latest data-service and node driver COMPASS-3943: Update to latest node driver 3.3.4 Nov 12, 2019
@imlucas
Copy link
Contributor Author

imlucas commented Nov 12, 2019

Instead use equivalent `require('mongodb').ReadPreference`
@imlucas imlucas marked this pull request as ready for review November 12, 2019 21:38
@imlucas imlucas requested review from durran and lrlna November 12, 2019 21:39
@imlucas
Copy link
Contributor Author

imlucas commented Nov 12, 2019

macOS installer:
https://s3.amazonaws.com/mciuploads/10gen-compass-testing/e4dc49638bfc9a09339678848aef21b876f65e32/MongoDB%20Compass%20Dev.dmg

You can copy the bulk connection metadata from Beta like below. You'll just need to re-enter passwords:

cp ~/Library/Application\ Support/MongoDB\ Compass\ Beta/Connections/*.json ~/Library/Application\ Support/MongoDB\ Compass\ Dev/Connections/

Copy link
Contributor

@lrlna lrlna left a comment

Choose a reason for hiding this comment

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

I've tried a bunch of ways that I used get the timeout warning, and I don't think I can get it any more. IMO, let's merge this down, and see what people say when they play around with it!

@imlucas
Copy link
Contributor Author

imlucas commented Nov 13, 2019

@lrlna awesome! Thank you

@imlucas imlucas merged commit 3125a2c into master Nov 13, 2019
@imlucas imlucas deleted the update-driver branch November 13, 2019 15:34
imlucas added a commit that referenced this pull request Nov 13, 2019
* chore: update to node [email protected]

* chore: remove extraneous mongodb-core dependency

* COMPASS-3943: Update to [email protected]

* chore: update to `[email protected]`

mongodb-js/data-service#154

* fix: Deprecate usage of mongodb-core

Instead use equivalent `require('mongodb').ReadPreference`
durran pushed a commit that referenced this pull request Nov 13, 2019
* chore: update to node [email protected]

* chore: remove extraneous mongodb-core dependency

* COMPASS-3943: Update to [email protected]

* chore: update to `[email protected]`

mongodb-js/data-service#154

* fix: Deprecate usage of mongodb-core

Instead use equivalent `require('mongodb').ReadPreference`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants