CSHARP-6007: Mark Server version 4.2 as EOL from driver's PoV (Min server version as 4.4, minWireVersion as 9)#2016
CSHARP-6007: Mark Server version 4.2 as EOL from driver's PoV (Min server version as 4.4, minWireVersion as 9)#2016sanych-sun wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
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.__supportedWireVersionRangefromServer42toServer44, update derived tests, and remove pre-4.4Feature.*Supports(...)test requirements throughout the test suite. - Delete
FindProjectionCheckerand simplifyFindOperation/FindOneAnd*Operation/LinqProviderAdapter/CoreSession.EnsureTransactionsAreSupported/Server.ShouldClearConnectionPoolForChannelException/DefaultAuthenticatorto drop 4.2-era branches; markHintForFindAndModifyFeatureobsolete and introduce a new (currently only test-consumed)HintForFindAndModifyOperationsfeature. - 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.
|
|
||
| /// <summary> | ||
| /// Gets the hint for update and replace operations feature. | ||
| /// </summary> |
| /// Gets the hint for find and modify operations feature. | ||
| /// </summary> | ||
| public static Feature HintForFindAndModifyOperations => __hintForFindAndModifyOperations; | ||
|
|
||
| /// <summary> |
| // 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 |
There was a problem hiding this comment.
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
…rver version as 4.4, minWireVersion as 9)
No description provided.