Skip to content

Releases: mongodb/node-mongodb-native

v3.5.4

25 Feb 19:26
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.5.4 of the driver

Release Highlights

Regression in hasNext when piping a cursor

Pierre Mallet and @Sintendo helped identify a regression with our cursors which did not
properly rewind a cursor when hasNext was called before the cursor was piped.

Regression in server selection queue processing

A change introduced in v3.5.3 converted the server selection loop from a loop with timers
to a queue of callbacks. A subtle bug was introduced to the code to process the quere where
the upper bound of a for loop was using a dynamically decreasing length, leading to some
operations being ignored, and ultimately timing out. Many thanks to Frederic Maillasson,
@paulrobinson, and @adityapatadia for helping uncover this issue

Only ensure minimum connection pool size if a size is specified

User @millerick submitted a PR short circuiting the background task for ensuring a minimum
pool size if no minimum size was set.

Release Notes

Bug

  • [NODE-2454] - Cursor.hasNext() seems to consume first document when the cursor is piped in a writable stream
  • [NODE-2464] - max election ID comparison uses invalid comparison for tracking
  • [NODE-2466] - Driver does not seem to properly recover from a long disconnection with primary server
  • [NODE-2467] - MongoServerSelectionError when using useUnifiedTopology: true

Improvement

  • [NODE-2459] - Do not run minimum connection size task if there is no minimum pool size

v3.5.3

12 Feb 12:49
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.5.3 of the driver

Release Highlights

This patch release fixes one issue with command error handling during network errors, and one minor issue with multiple incoming wire messages not being properly processed.

Release Notes

Bug

  • [NODE-2435] - Unified topology does not transition server to Unknown on non-timeout operation error
  • [NODE-2437] - Multiple incoming message packets are not processed correctly

Improvement

  • [NODE-2438] - Add exhaust command support to transport layer
  • [NODE-2449] - Simplify server error handling in unified topology

v3.5.2

20 Jan 16:33
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.5.2 of the driver

Release Highlights

This patch release corrects a regression introduced in the 4.2 timeframe which would
effectively disable retryable operations for connection to MongoDB 4.2+. Additionally,
the server selection loop has been converted to a queue of callbacks to improve
readability, as well as performance in certain scenarios.

Release Notes

Bug

  • [NODE-2408] - retryWrites seems not to work as expected in failover test

Improvement

  • [NODE-2398] - Use a queue for server selection

v3.5.1

20 Jan 14:33
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.5.1 of the driver

Release Highlights

This patch release fixes a few regressions introduced with new connection pool, primarily
around the ability to use custom TLS certificates.

Release Notes

Bug

  • [NODE-2372] - db.findOne does not respect client setting bufferMaxEntries
  • [NODE-2401] - "readPreference.equals is not a function" exception thrown within executeWithServerSelection
  • [NODE-2424] - CMAP connection pool fails to create connection using SSL / TLS

v3.5.0

14 Jan 22:37
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.5.0 of the driver

Release Highlights

CMAP-compliant Connection Pool

This release introduces a modern replacement for the driver's connection pool, available only with the
unified topology. A major effort was made in early 2019 to fully specifiy connection pools for MongoDB
drivers (see: CMAP specification), and this release brings the Node.js driver in line with that
specification.

Traceability

The new pool supports monitoring for all aspects of its behavior. This allows deep introspection into
the operation of the connection pool, as well as an ability to profile the lifetime of an operation
when used in conjunction with command monitoring.

Stream-first Connection Design

The Connection class was completely rewritten for the new pool adopting a stream-first mentality. All
wire message processing and compression is handled in a duplex stream called the MessageStream, and
that stream is connected bidirectionally to the underlaying TCP socket. The result is a connection which
gains the general benefit of streams: better performance, less memory pressure, backpressure support. It
also opens the possiblity of supporting non-TCP/UDP streams as a transport for the driver.

waitQueueTimeoutMS

The new connection pool has a concept of a "wait queue", which allows operation requests to buffer waiting
for a connection to execute against. There is no timeout by default, but users can now specify a new value
waitQueueTimeoutMS in their connection string or MongoClient options to proactively cancel operations
that have waited too long.

Remember that the new connection pool is only available for the "Unified Topology", so remember to pass
useUnifiedTopology: true to your MongoClient constructor to use it!

Dedicated monitoring connection

Both the legacy and unified SDAM implementations have until now executed monitoring checks as priority
messages in the legacy Pool implementation. This means that monitoring (ismaster) operations were
prioritized over other queued operations, but also means that monitoring could be indefinitely blocked,
in particular during failover or black hole scenarios. The default socket timeout is null (read: Infinity),
so if the pool was completely saturated with operations, there may be no ability to execute a monitoring
check and determine that the connection to a server was no longer valid. This version of the driver
introduces a new Monitor class which manages its own dedicated monitoring connection to each known
node.

Server selection errors

In v3.3.0 of the driver we introduced a new MongoTimeoutError for all errors covered by the server
selection loop, leading to a spike in bug reports with a title similar to Server selection timed out after 30000ms.
Even though the error type itself had an attached reason field, we still feel it was easy to miss why
the selection had failed. As a result we have introduced a new type MongoServerSelectionError which
will use the originating error (reason) for its message, better informing users what caused a
selection error, while still also conveying it is an error in server selection.

Release Notes

New Feature

  • [NODE-1742] - Implement Connection Monitoring and Pooling spec
  • [NODE-2386] - Use a dedicated monitoring thread

Bug

  • [NODE-2400] - Synchronous errors are swallowed by executeOperation
  • [NODE-2417] - Server descriptions with me mismatch from primary response should be removed
  • [NODE-2418] - client platform not sent in metadata for CMAP connections

Improvement

  • [NODE-1619] - Remove wasteful empty Buffer allocations in `Connection`
  • [NODE-2049] - Add "connectionError" as a valid "reason" for a ConnectionCheckOutFailedEvent when connection set up fails
  • [NODE-2397] - Make server selection errors more informative
  • [NODE-2402] - Integrate CMAP connection pool into unified topology
  • [NODE-2419] - Improve traceability of CMAP events
  • [NODE-2033] - Ignore ConnectionReadyEvent in CMAP pool creation test

v3.4.1

19 Dec 19:26
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.4.1 of the driver

Release Highlights

This is a patch release addressing two regressions introduced in bulk writes and SCRAM authentication.

Release Notes

Bug

  • [NODE-2383] - Unordered bulk write reports wrong error indexes
  • [NODE-2390] - Sporadic connection errors with AWS Lambda

v3.4.0

10 Dec 16:41
Compare
Choose a tag to compare

The MongoDB Node.js team is pleased to announce version 3.4.0 of the driver

Release Highlights

Client Side Field Level Encryption (CSFLE)

The major functionality introduced in this release, and indeed the reason for the minor version bump, is full support for MongoDB's Client Side Field Level Encryption. The bulk of the support comes through an addon module mongodb-client-encryption, please refer to the reference documentation for more details.

TLS Option Variants

This release also introduces a number of new connection string options related to TLS. In order to unify uri options across all MongoDB drivers, and to better signal the technology the driver is actually using, all ssl related options now have a corresponding tls variant. NOTE: your application will not break if you continue to use the ssl variants, but deprecation warnings will be introduced prior to the 4.x driver release.

@adityapatadia initially pointed out that these tls variants had no effect, now they do. Thank you @adityapatadia!

mongodb+srv

A critical bug was found by @ephemer with the recently introduced "mongos discovery", where a typo caused DNS polling to occur at very fast intervals.

Additionally, user @mpilar identified and fixed a bug with our mongodb+srv parsing, where user-provided client options were not overriding those provided by a TXT record lookup.

Thank you very much @ephemer and @mpilar!

server selection

@adityapatadia also helped find a bug in the server selection code which rendered selection with a nearest read preference non-functional. Thanks again @adityapatadia!

bulkWrite

A small bug was fixed causing errors in an unordered bulk write to be reported in incorrect order. If an error occurs in a bulk write now, then it will show up in the writeErrors field of the resulting BulkWriteError with an index that corresponds to the position the operation had in the initial input.

Release Notes

Bug

  • [NODE-1547] - Default Port is not applied
  • [NODE-1991] - replaceOne() also returns the replacement document?
  • [NODE-2089] - Only apply TransientTransactionError label within a transaction
  • [NODE-2308] - Bulk write error returns incorrect index in WriteError for unordered writes
  • [NODE-2334] - Driver must error if autoEncryption is attempted against wire version < 8
  • [NODE-2335] - Node Driver does not follow Initial DNS Seedlist Discovery spec
  • [NODE-2353] - Timed out connections should not half-close on destroy
  • [NODE-2356] - nearest server is not selected when useUnifiedTopology is set
  • [NODE-2359] - tls option in connection URI has no effect
  • [NODE-2375] - Typo in `rescanIntervalSrvMS` causes spike in DNS lookups
  • [NODE-2376] - Malicious server can accept incomplete SCRAM authentication and bypass mutual authentication

New Feature

  • [NODE-2094] - FLE GA Support

    Improvement

    • [NODE-2024] - Document createIndexes usage
    • [NODE-2052] - [FLE] Add a corpus test that exhaustively enumerates all ways to encrypt all BSON value types
    • [NODE-2053] - [FLE] Add prose test for explicit encryption with key alt name
    • [NODE-2298] - Add driver API documentation for Field Level Encryption
    • [NODE-2363] - Allow connection establishment to be cancelled
    • [NODE-2306] - Driver module does not export `BulkWriteError`
    • [NODE-2338] - build FLE addon on windows

    v3.3.5

    26 Nov 14:01
    Compare
    Choose a tag to compare

    The MongoDB Node.js team is pleased to announce version 3.3.5 of the driver

    Release Highlights

    unified topology

    This patch release includes additional fixes for the regression in the unified topology discovered in v3.3.2, expanding our testing infrastructure to include a simulated workload during failover testing. There was a bug when connecting to single-node replicasets which could result in a stack overflow which was corrected. Additionally, events and options which are incompatible with the unified topology will now emit a warning message.

    mongodb+srv

    The release also includes a fix submitted by @mpilar, who found an inconsistency in our implementation of the "Initial Seedlist Discovery" specification. An authSource specified in the options passed to MongoClient would be overridden by an authSource provided in the TXT record checked during initial seedlist discovery over SRV. Thank you very much Miguel!

    bulkWrite

    BulkWriteError is now exported at the top level of the module so that users can catch them easily. Additionally, a fix was made to ensure that the index of operations passed into an unordered bulk operation were preserved when reporting possible errors in the future.

    Release Notes

    Bug

    • [NODE-1747] - Replica set causes MongoNetworkError due to not connecting with fully qualified domain name
    • [NODE-2089] - Only apply TransientTransactionError label within a transaction
    • [NODE-2143] - getaddrinfo ENOTFOUND error on Windows 10 due to failed fallback to ipv4 after ipv6 lookup fails
    • [NODE-2308] - Bulk write error returns incorrect index in WriteError for unordered writes
    • [NODE-2332] - useUnifiedTopology - replicaset
    • [NODE-2335] - Node Driver does not follow Initial DNS Seedlist Discovery spec
    • [NODE-2342] - Enabling useUnifiedTopology results in stack overflow when connecting to uninitialized replica set

    Improvement

    • [NODE-2348] - Document and notify on deprecated events and options for unified topology
    • [NODE-2306] - Driver module does not export `BulkWriteError`

    v3.3.4

    11 Nov 22:36
    Compare
    Choose a tag to compare

    The MongoDB Node.js team is pleased to announce version 3.3.4 of the driver

    Release Highlights

    This release primary consists of improvements to the "unified topology". In particular, a regression with interaction between the connection pool and topology could result in servers which "go away" (due to network error, for example) would not return, resulting in a MongoTimeoutError.

    Release Notes

    Bug

    • [NODE-2123] - MaxListenersExceededWarning caused by topologyDescriptionChanged
    • [NODE-2214] - Incorrect removal of Unknown server type from ReplicaSetNoPrimary topology
    • [NODE-2234] - isConnected() takes legacy path with useUnifiedTopology
    • [NODE-2251] - `useUnifiedTopology` continuously emits 'close' event when replica set member is down
    • [NODE-2268] - Legacy SDAM ReplSet topology reports incorrect topology ID
    • [NODE-2270] - Servers are not removed from unknownServer list, leaking
    • [NODE-2274] - Unified topology never regains nodes which temporarily go down
    • [NODE-2277] - Unhandled error when server is offline

    Improvement

    • [NODE-1517] - normalize state management across all stateful types
    • [NODE-2257] - Introduce ServerDescription equality to reduce SDAM events
    • [NODE-2263] - support ability to pass hint to update
    • [NODE-2276] - Add SDAM test for debouncing topology description updates
    • [NODE-2280] - Integrate a state machine into the unified topology
    • [NODE-2309] - Document the design and rationale of the unified topology
    • [NODE-2316] - Correct client metadata for unified topology

    v3.3.0

    13 Aug 19:22
    Compare
    Choose a tag to compare

    The MongoDB Node.js team is pleased to announce version 3.3.0 of the driver

    Release Highlights

    Server Version 4.2 feature support

    This latest release brings support for features in the newly released MongoDB v4.2:

    • Distributed Transactions
    • On-Demand Materialized Views with the $merge operator
    • Wildcard Indexes
    • Retryable Reads
    • MongoDB Query Language Enhancements.

    SRV Polling for Sharded Clusters

    The Driver has supported connecting to a cluster using an SRV record since version 3.0. Prior to now, we would only resolve the SRV record when initially connecting. This was fine for single replica sets, as the driver is able to discover new members added after initial connect from any member of a replica set. However, in a sharded deployment, individual mongos processes do not have an awareness of each other. This means that if the deployment changes in a shared cluster, the driver would have no way of knowing without disconnecting and connecting with a new client.

    Starting in 3.3, if a driver connects to a sharded cluster with an SRV record, we will now periodically check that SRV record for any changes in the deployment, and update the client-side connections accordingly.

    **NOTE: This feature is only available when starting a client with { useUnifiedTopology: true } **

    Beta support for MongoDB Client-Side Encryption

    The driver now has support for MongoDB Client-Side Encryption. This requires installing the mongodb-client-encryption npm package in your project.

    Merged mongodb-core into node-mongodb-native

    Up until this release, the mongodb driver has consisted of two components:

    • mongodb-core: The low-level engine of the driver.
    • node-mongodb-native: The API layer of the driver, published as mongodb

    Over time, this separation has done more harm than good, and has led to increased development time for repairing bugs and implementing new features. Starting in the 3.3 release of mongodb, we have merged mongodb-core into node-mongodb-native, removing this barrier to development.

    Release Notes

    Bug

    • [NODE-1480] - 'Should handle Error thrown during operation' in error_tests.js should handle exception
    • [NODE-1994] - fix 'should correctly handle multiple unordered batch API'
    • [NODE-2022] - startAtOperationTime and resumeToken conflict on cursor restarts
    • [NODE-2051] - MongoClient with autoEncryption does not clean up MongoCryptD client
    • [NODE-2054] - [FLE] AutoEncrypter MongoClient does not use new url parser
    • [NODE-2060] - can't use database named 'constructor'
    • [NODE-2067] - requestid overflow
    • [NODE-2075] - Ensure error events also emit close events in change_stream.js
    • [NODE-2077] - Invalid staleness calculation

    Epic

    New Feature

    • [NODE-1740] - Implement Unified URI Options
    • [NODE-1745] - Support polling SRV records for mongos discovery
    • [NODE-1750] - Connections survive primary stepdown
    • [NODE-1766] - Aggregate command must be sent to a primary if it uses $out
    • [NODE-1820] - Resync CRUD spec tests to use transaction spec test format
    • [NODE-1824] - Support 'startAfter' option to the $changeStream stage
    • [NODE-1864] - Support Retryable Writes on by Default
    • [NODE-1866] - Support postBatchResumeToken in change streams
    • [NODE-1880] - Add support for majority read concern level to Aggregation $out
    • [NODE-1896] - Implement executeOperationV2
    • [NODE-1902] - Add "aspects" to all operation classes
    • [NODE-1920] - Add the ability to specify a pipeline to an update command
    • [NODE-1931] - Ensure 4.0 drivers return an error when attempting sharded transactions on 4.2
    • [NODE-1965] - More useful error when bulk writes fail
    • [NODE-2023] - set default for useRecoveryToken to true
    • [NODE-2071] - [FLE]: use crypto callbacks
    • [NODE-2078] - Improve error message for missing `mongodb-client-encryption`
    • [NODE-2095] - Operating System Removals/Updates for 4.2
    • [NODE-2098] - Raise an actionable error message when retryWrites fails due to using an unsupported storage engine
    • [NODE-2102] - Mark the FLE feature as "Beta" in driver docs

    Task

    • [NODE-1854] - POC - Support Client-side Field Level Encryption
    • [NODE-1949] - Add tests for postBatchResumeToken support
    • [NODE-1950] - Test writes in transactions do not send writeConcern when collection write concern is w=0
    • [NODE-1951] - Amend change stream missing resume token tests for wire version 8+
    • [NODE-1966] - Merge core and native modules into a single driver
    • [NODE-1979] - Clarify resume token used in resuming and getResumeToken
    • [NODE-2004] - Spec: Finer-grained updates from aggregation via $merge
    • [NODE-2017] - Fix result assertion in change stream spec test

    Improvement

    • [NODE-1425] - validate internal representation of `ReadPreference`
    • [NODE-1557] - Clean up constructor for ClientSession
    • [NODE-1682] - Implement connection pool reset
    • [NODE-1756] - applyWriteConcern should take a writeConcern
    • [NODE-1811] - Refactor readconcern tests
    • [NODE-1897] - Move all operations to their own classes
    • [NODE-1910] - Refactor findAnd* operations to extend findAndModify
    • [NODE-1943] - Move executeOperation to executeLegacyOperation
    • [NODE-1944] - Use new CommandOperation for operations
    • [NODE-1947] - create a `MongoNamespace` for database and...
    Read more