Skip to content

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

Open
johnmtll wants to merge 37 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 37 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 updated since they rely on shared infra which is no longer driver compatible. Setup scripts which facilitate connections to LDAP/Kerberos now use vars which aim at a compatible server instance.
  • The spec test runner has been updated to identify tests which attempt to configure server version attestation with too-low of a version. These tests will skip
  • Kerberos/LDAP tests have been changed. The assertions embedded in these tests served the purpose of ensuring the server was authenticated, however there's already a codepath that precedes these assertions that ensures that--client.connect(), making these assertions redundant.

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 thread test/spec/server-discovery-and-monitoring/errors/post-42.yml.template Outdated
Comment thread test/unit/assorted/server_discovery_and_monitoring.spec.test.ts Outdated
Comment thread test/integration/retryable-writes/retryable_writes.spec.prose.test.ts Outdated
Comment thread src/bulk/common.ts Outdated
Comment thread src/error.ts
@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
@johnmtll
johnmtll force-pushed the NODE-7547/earliest-supported-server-version-eol branch from 7191aa3 to 2447c1b Compare July 20, 2026 20:34
@johnmtll
johnmtll marked this pull request as draft July 20, 2026 21:17
@johnmtll
johnmtll marked this pull request as ready for review July 21, 2026 13:31
Comment thread src/operations/indexes.ts Outdated
Comment thread src/error.ts Outdated

@seanrmilligan seanrmilligan 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.

connection.ts has:

  private get supportsOpMsg(): boolean {
    return (
      this.description != null &&
      // TODO(NODE-6672,NODE-6287): This guard is primarily for maxWireVersion = 0
      maxWireVersion(this) >= 6 &&
      !this.description.__nodejs_mock_server__
    );
  }

It's linked to other work so I don't know what can of worms that is, but consider that the max wire version must always be >=6 because the min wire version is now 9. (Optional)

@seanrmilligan

Copy link
Copy Markdown
Contributor

README.md:

"The driver currently supports 4.2+ servers."

@seanrmilligan

Copy link
Copy Markdown
Contributor

We spoke out of band about our strategy to clean up comments about features where min versions are now below the floor server version they support. Thanks for cleaning those up! After those changes, LGTM

seanrmilligan
seanrmilligan previously approved these changes Jul 24, 2026
@seanrmilligan seanrmilligan added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jul 24, 2026
@johnmtll
johnmtll requested a review from seanrmilligan July 24, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Review Needs review from team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants