Skip to content

CSHARP-6007: Mark Server version 4.2 as EOL from driver's PoV (Min server version as 4.4, minWireVersion as 9)#2016

Open
sanych-sun wants to merge 4 commits into
mongodb:mainfrom
sanych-sun:CSHARP-6007
Open

CSHARP-6007: Mark Server version 4.2 as EOL from driver's PoV (Min server version as 4.4, minWireVersion as 9)#2016
sanych-sun wants to merge 4 commits into
mongodb:mainfrom
sanych-sun:CSHARP-6007

Conversation

@sanych-sun
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 28, 2026 20:28
@sanych-sun sanych-sun requested a review from a team as a code owner May 28, 2026 20:28
@sanych-sun sanych-sun requested a review from ajcvickers May 28, 2026 20:28
@sanych-sun sanych-sun requested a review from BorisDog May 28, 2026 20:29
@sanych-sun sanych-sun added the maintenance Non-code maintenance (deps, docs, configs, etc.). label May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Raises the driver's minimum supported MongoDB server version from 4.2 to 4.4 (minimum wire version 8 → 9), and removes/cleans up feature gates, tests, and CI matrix entries that targeted the now-unsupported 4.2 era. Several pre-4.4 code paths and helpers (e.g. FindProjectionChecker, CompatibilityLevel-driven projection fallback, pre-4.4 connection-pool-clearing behaviour, transactions-feature gating) are removed.

Changes:

  • Bump WireVersion.__supportedWireVersionRange from Server42 to Server44, update derived tests, and remove pre-4.4 Feature.*Supports(...) test requirements throughout the test suite.
  • Delete FindProjectionChecker and simplify FindOperation / FindOneAnd*Operation / LinqProviderAdapter / CoreSession.EnsureTransactionsAreSupported / Server.ShouldClearConnectionPoolForChannelException / DefaultAuthenticator to drop 4.2-era branches; mark HintForFindAndModifyFeature obsolete and introduce a new (currently only test-consumed) HintForFindAndModifyOperations feature.
  • Remove MongoDB 4.2 (and Ubuntu 18.04) variants from evergreen/evergreen.yml, including CSFLE, OData and compression matrices.

Reviewed changes

Copilot reviewed 89 out of 89 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/MongoDB.Driver/Core/Misc/WireVersion.cs Raises min supported wire version to Server44.
src/MongoDB.Driver/Core/Misc/Feature.cs Marks HintForFindAndModifyFeature obsolete; adds new HintForFindAndModifyOperations; removes [Obsolete] from HintForUpdateAndReplaceOperations.
src/MongoDB.Driver/Core/Misc/HintForFindAndModifyFeature.cs Marks class [Obsolete].
src/MongoDB.Driver/Core/Operations/FindProjectionChecker.cs Deleted; pre-4.4 projection check no longer needed.
src/MongoDB.Driver/Core/Operations/FindOperation.cs Drops FindProjectionChecker call.
src/MongoDB.Driver/Core/Operations/FindOneAndDeleteOperation.cs / FindOneAndReplaceOperation.cs / FindOneAndUpdateOperation.cs Drop FindProjectionChecker; wrap remaining obsolete hint check with pragmas + TODO (CSHARP-6061).
src/MongoDB.Driver/Core/Servers/Server.cs / DefaultServer.cs / LoadBalancedServer.cs Remove maxWireVersion parameter and pre-4.4 state-change pool-clear behavior.
src/MongoDB.Driver/Core/Bindings/CoreSession.cs Simplifies EnsureTransactionsAreSupported to only reject standalone.
src/MongoDB.Driver/Authentication/DefaultAuthenticator.cs Removes ScramSha256Authentication gating for saslSupportedMechs hello.
src/MongoDB.Driver/Linq/LinqProviderAdapter.cs Removes pre-4.4 client-side projection fallback.
src/MongoDB.Driver/ProjectionDefinitionBuilder.cs Removes unused PositionalOperatorProjectionDefinition class.
tests/MongoDB.Driver.TestHelpers/Core/XunitExtensions/RequireServer.cs Drops CSFLE wire-version precondition in CSFLE requirement check.
tests/MongoDB.Driver.Tests/Specifications/server-selection/ServerSelectionTestHelpers.cs Default max wire version 8→9, default server version 4.2→4.4.
tests/.../WireVersionTests.cs, ClusterTests.cs, ServerDescriptionTests.cs Update expected supported wire range / compatibility test data to 9..29.
tests/.../ConnectionInitializerTests.cs, AuthenticationHelperTests.cs, MongoDBX509AuthenticatorTests.cs, CSharp3173Tests.cs Update hello max wire versions from Server42/Server36 to Server44.
tests/.../WritableServerSelectorTests.cs Replaces Server42 secondary with Server44.
tests/.../CoreSessionTests.cs Simplifies transaction-support test to only standalone rejection.
tests/.../ConnectionsSurvivePrimaryStepDownTests.cs Removes pool-clear branches tied to KeepConnectionPoolWhenNotPrimaryConnectionException.
tests/.../BulkUpdateOperationTests.cs, BulkMixedWriteOperationTests.cs, RetryableUpdateCommandOperationTests.cs Drop dead HintForUpdateAndReplaceOperations branches in hint-not-supported tests.
tests/.../FindOneAnd*OperationTests.cs Switch to HintForFindAndModifyOperations.FirstSupportedWireVersion; remove Execute_with_hint_should_throw_when_hint_is_not_supported tests.
tests/.../ChangeStreamCursorTests.cs Remove pre-PBRT branches.
tests/.../AsyncCursorTests.cs Remove pre-4.4 getMore-comment test.
tests/.../AggregateToCollectionOperationTests.cs Remove AggregateMerge requirement.
tests/.../EncryptionTestHelper.cs, ClientEncryptionTests.cs, AutoEncryptionTests.cs, ClientEncryptionProseTests.cs, ClientEncryptionExamples.cs, ExplicitEncryptionExamples.cs Drop CSFLE feature requirements / early return.
tests/.../AuthenticationTests.cs Drop ScramSha256Authentication precondition.
tests/.../ListDatabasesTests.cs, IFindFluentExtensionsTests.cs, OfTypeMongoCollectionTests.cs, PinnedShardRouterTests.cs, RetryableWritesTests.cs, ClusterTests.cs, ConnectionsSurvivePrimaryStepDownTests.cs, IFindFluentExtensionsTests.cs, MqlToHashedIndexKeyTests.cs Drop now-unconditionally-supported feature requirements.
tests/.../Linq3Implementation/Jira/CSharpTests.cs and Linq3ImplementationWithLinq2Tests/.cs Drop Feature.* requirements (projection, ToString, ToConversionOperators, SetStage, TrigOperators, etc.) and remove CompatibilityLevel plumbing.
tests/.../CSharp4734Tests.cs Remove fallback assertions for pre-4.4 NotSupportedException from find projection.
tests/.../Sessions/SessionsProseTests.cs, retryable-reads/RetryableReadsProseTests.cs, retryable-writes prose tests, CrudProseTests.cs, AggregateTest.cs Drop FailPointsFailCommand[ForSharded] / FailPointsBlockConnection / ClientSideEncryption / Transactions requirements.
tests/MongoDB.Driver.Examples/* Drop ClientSideEncryption / Transactions feature requirements in example tests.
evergreen/evergreen.yml Remove 4.2 + Ubuntu 18.04 variants; adjust OData/CSFLE matrices.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/MongoDB.Driver/Core/Misc/Feature.cs Outdated

/// <summary>
/// Gets the hint for update and replace operations feature.
/// </summary>
Comment thread src/MongoDB.Driver/Core/Misc/Feature.cs Outdated
Comment on lines 419 to 423
/// Gets the hint for find and modify operations feature.
/// </summary>
public static Feature HintForFindAndModifyOperations => __hintForFindAndModifyOperations;

/// <summary>
Comment on lines +80 to +83
// TODO: Investigate and remove code below in scope of https://jira.mongodb.org/browse/CSHARP-6061
#pragma warning disable CS0618 // Type or member is obsolete
if (Feature.HintForFindAndModifyFeature.DriverMustThrowIfNotSupported(wireVersion) || (WriteConcern != null && !WriteConcern.IsAcknowledged))
#pragma warning restore CS0618 // Type or member is obsolete
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, but we have a discrepancy in CSharp implementation and CRUD spec which we want to investigate and fix separately . I've decided not to remove this feature check now to reduce the noise around the code. This will be addressed as a part of https://jira.mongodb.org/browse/CSHARP-6061

Comment thread src/MongoDB.Driver/Core/Misc/Feature.cs Outdated
Comment thread src/MongoDB.Driver/Core/Misc/Feature.cs Outdated
Comment thread src/MongoDB.Driver/Core/Misc/Feature.cs Outdated
Copy link
Copy Markdown
Contributor

@BorisDog BorisDog left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Non-code maintenance (deps, docs, configs, etc.).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants