Skip to content

feat(NODE-7547): bump minimum support server/wire versions to '4.4' & '9' respectively#4994

Open
johnmtll wants to merge 21 commits into
mainfrom
NODE-7547/earliest-supported-server-version-eol
Open

feat(NODE-7547): bump minimum support server/wire versions to '4.4' & '9' respectively#4994
johnmtll wants to merge 21 commits into
mainfrom
NODE-7547/earliest-supported-server-version-eol

Conversation

@johnmtll

@johnmtll johnmtll commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Summary of Changes

Bumps the minimum supported server version to 4.4, and the minimum supported wire version to 9. This requires some source code changes which remove functionally-dead code. Tears out the 4.2 server infra & eliminates test fixtures which rely on such infra. Also updates various comment verbiage to implicitly callout 4.4 as our earliest supported server version.

Notes for Reviewers
  • Kerberos/LDAP tests have been skipped since they rely on shared infra which is no longer driver compatible. This will require a future change to target a compatible host
  • Error spec tests are skipped as they are no longer compatible with wire v9. These tests are not vendored from our specifications repo, but are rather locally generated and committed, and ideally should be deleted.

What is the motivation for this change?

Release Highlight

Bumped minimum server version (4.2 -> 4.4) & minimum wire version (8 -> 9)

  • This change finalizes dropping support for mongo server v4.2, which has been marked EOL. To continue using the driver, use mongo server v4.4 at minimum.

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@johnmtll
johnmtll force-pushed the NODE-7547/earliest-supported-server-version-eol branch from 90a1d86 to 334d8f3 Compare July 13, 2026 14:05
@johnmtll johnmtll changed the title Node 7547/earliest supported server version eol feat(NODE-7547: bump minimum support server/wire versions to '4.4' & '9' respectively Jul 14, 2026
@johnmtll
johnmtll force-pushed the NODE-7547/earliest-supported-server-version-eol branch from ca57a9f to 3297567 Compare July 14, 2026 22:17
@johnmtll johnmtll changed the title feat(NODE-7547: bump minimum support server/wire versions to '4.4' & '9' respectively feat(NODE-7547): bump minimum support server/wire versions to '4.4' & '9' respectively Jul 16, 2026
@johnmtll
johnmtll marked this pull request as ready for review July 16, 2026 14:28
@johnmtll
johnmtll requested a review from a team as a code owner July 16, 2026 14:28
Copilot AI review requested due to automatic review settings July 16, 2026 14:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Node.js driver’s compatibility floor by bumping the minimum supported MongoDB server version to 4.4 and the minimum supported wire version to 9, and then removing/adjusting code paths and tests that only existed to support 4.2-era behavior.

Changes:

  • Bump server/wire version constants and remove 4.2 compatibility branches (e.g., comment gating, compatibility errors, retryable write label checks).
  • Update unit/integration tests and mocks to reflect 4.4+ behavior; remove 4.2-only test cases and metadata.
  • Update Evergreen CI matrix/tasks to stop running MongoDB 4.2 variants; add/adjust skips where legacy infra/spec fixtures no longer align.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/unit/operations/list_collections.test.js Removes unit coverage for comment suppression on wire versions < 9.
test/unit/error.test.ts Drops below-4.4 retryable-write-label cases and updates call signature usage.
test/unit/cmap/wire_protocol/constants.test.ts Updates expectations for min server/wire constants (4.4 / 9).
test/unit/assorted/server_discovery_and_monitoring.spec.test.ts Adds skipping of certain SDAM error spec tests that now fail under min wire v9.
test/tools/mongodb-mock/index.js Updates default mock hello to report wire version 9 (4.4).
test/spec/server-discovery-and-monitoring/errors/post-42.yml.template Updates generated SDAM error template to 4.4+/wire 9 requirements.
test/spec/server-discovery-and-monitoring/errors/post-42-ShutdownInProgress.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-PrimarySteppedDown.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-NotWritablePrimary.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-NotPrimaryOrSecondary.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-NotPrimaryNoSecondaryOk.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-LegacyNotPrimary.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-InterruptedDueToReplStateChange.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/spec/server-discovery-and-monitoring/errors/post-42-InterruptedAtShutdown.yml Updates SDAM error fixture to wire 9 + runOnRequirements.
test/manual/ldap.test.ts Skips LDAP manual tests pending infra migration to compatible server.
test/manual/kerberos.test.ts Skips Kerberos manual tests pending infra migration to compatible server.
test/integration/sessions/sessions.prose.test.ts Updates prose test comments to reference 4.4+ baseline.
test/integration/server-selection/server_selection.prose.sharded_retryable_reads.test.ts Raises minimum server metadata to >= 4.4.0.
test/integration/server-selection/server_selection.prose.operation_count.test.ts Raises minimum server metadata/comment to >= 4.4.0.
test/integration/server-discovery-and-monitoring/server_discovery_and_monitoring.prose.test.ts Raises minimum server metadata/comment to >= 4.4.0.
test/integration/retryable-writes/retryable_writes.spec.prose.test.ts Raises minimum server metadata/comments to 4.4+ and adjusts wording.
test/integration/retryable-reads/retryable_reads.spec.prose.test.ts Raises minimum server comment to 4.4.0+.
test/integration/crud/find.test.ts Removes a 4.2-only $where Code test and simplifies imports.
test/integration/connections-survive-step-down/connections_survive_step_down.prose.test.ts Updates prose comments to reference 4.4+ baseline.
test/integration/connection-monitoring-and-pooling/rtt_pinger.test.ts Updates comment about pre-hello server version pinning (4.4.x only).
test/integration/client-side-operations-timeout/client_side_operations_timeout.prose.test.ts Updates prose comment to require 4.4+ enterprise baseline.
test/integration/change-streams/change_stream.test.ts Removes 4.2-specific failpoint branching and related semver helper.
src/utils.ts Removes now-obsolete commentary around future min-wire-version behavior.
src/sdam/server.ts Updates retryable-write-label logic to no longer depend on max wire version/server type.
src/operations/list_databases.ts Always attaches comment option now that min wire version is 9.
src/operations/list_collections.ts Always attaches comment option now that min wire version is 9.
src/operations/indexes.ts Removes pre-4.4 compatibility error for commitQuorum.
src/operations/get_more.ts Always attaches comment option now that min wire version is 9.
src/operations/find_and_modify.ts Removes pre-4.4 compatibility error for unacknowledged hint.
src/operations/delete.ts Removes pre-4.4 compatibility error for unacknowledged deletes with hint.
src/error.ts Simplifies retryable write label decisions to align with 4.4+ baseline.
src/cmap/wire_protocol/constants.ts Updates MIN_SUPPORTED_SERVER_VERSION to 4.4 and MIN_SUPPORTED_WIRE_VERSION to 9.
src/cmap/connect.ts Updates handshake error labeling path to use the new retryable-write-label helper signature.
src/cmap/command_monitoring_events.ts Updates docs/comments to reflect 4.4+ baseline for serverConnectionId notes.
src/cmap/auth/mongodb_aws.ts Removes 4.4+ compatibility check since <4.4 is no longer supported.
src/bulk/common.ts Updates docs comment to reference 4.4+ (pipeline updates).
.evergreen/generate_evergreen_tasks.js Updates CSFLE mongocryptd task gating from 4.2+ to 4.4+.
.evergreen/config.yml Removes MongoDB 4.2 build variants/tasks and related TLS/CSFLE 4.2 tasks.
.evergreen/ci_matrix_constants.js Removes MongoDB 4.2 from the evergreen CI version matrix.

Comment on lines 1 to +5
# Autogenerated tests for SDAM error handling, see generate-error-tests.py
description: Post-4.2 {error_name} error
uri: mongodb://a/?replicaSet=rs
runOnRequirements:
- minServerVersion: "4.4"
Comment on lines +194 to +206
// These tests assert on Post-4.2 error handling using servers that report wire version 8
// (MongoDB 4.2), which is below the driver's minimum supported wire version of 9 (MongoDB 4.4).
// As a result the topology is reported as incompatible and the outcome assertions no longer hold.
const SKIPPED_TESTS = new Set([
'Post-4.2 InterruptedAtShutdown error',
'Post-4.2 InterruptedDueToReplStateChange error',
'Post-4.2 LegacyNotPrimary error',
'Post-4.2 NotPrimaryNoSecondaryOk error',
'Post-4.2 NotPrimaryOrSecondary error',
'Post-4.2 NotWritablePrimary error',
'Post-4.2 PrimarySteppedDown error',
'Post-4.2 ShutdownInProgress error'
]);
describe('2. Test that drivers properly retry after encountering PoolClearedErrors.', () => {
// This test MUST be implemented by any driver that implements the CMAP specification.
// This test requires MongoDB 4.2.9+ for blockConnection support in the failpoint.
// This test requires MongoDB 4.4.+ for blockConnection support in the failpoint.

context('Not Primary - Keep Connection Pool', { requires: { topology: ['replicaset'] } }, () => {
// This test requires a replica set with server version 4.2 or higher.
// This test requires a replica set with server version 4.4or higher.
Comment thread src/bulk/common.ts
* bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }});
*
* // Update using a pipeline (requires Mongodb 4.2 or higher)
* // Update using a pipeline (requires Mongodb 4.4 or higher)
Comment thread src/error.ts
Comment on lines +1396 to 1400
export function needsRetryableWriteLabel(error: Error): boolean {
// pre-4.4 server, then the driver adds an error label for every valid case
// execute operation will only inspect the label, code/message logic is handled here
if (error instanceof MongoNetworkError) {
return true;
@PavelSafronov PavelSafronov self-assigned this Jul 16, 2026
@PavelSafronov PavelSafronov added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants