-
Notifications
You must be signed in to change notification settings - Fork 531
MONGOID-3381 MONGOID-3640 Remove support for server versions 3.6 and 4.0 #2986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Removes driver support for MongoDB server versions 3.6 and 4.0 by raising the minimum supported wire version, deleting legacy code paths, and simplifying/adjusting specs that previously gated behavior by server version.
Changes:
- Raise minimum supported wire protocol version (to MongoDB 4.2+) and remove deprecated wire versions handling.
- Remove legacy validation/branching code for pre-4.2 servers (sessions, OP_QUERY/legacy behaviors, legacy error parsing, feature gates).
- Update and prune test suite coverage and spec test fixtures to match the new supported server range.
Reviewed changes
Copilot reviewed 178 out of 178 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/support/spec_setup.rb | Simplify auth-related createUser error matching for supported servers. |
| spec/support/spec_config.rb | Remove FCV gating and legacy version notes in suite config. |
| spec/support/shared/session.rb | Remove pre-3.6 session gating and legacy branches in shared examples. |
| spec/support/shared/scram_conversation.rb | Simplify connection doubles by removing legacy OP_MSG feature stubs. |
| spec/stress/connection_pool_timing_spec.rb | Remove version gating around replica set election tuning and tests. |
| spec/spec_tests/transactions_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/transactions_api_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/sdam_spec.rb | Remove obsolete Ruby 1.9-era comment. |
| spec/spec_tests/retryable_writes_unified_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/retryable_writes_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/retryable_reads_unified_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/retryable_reads_spec.rb | Remove WiredTiger requirement gating. |
| spec/spec_tests/data/sdam/single/too_old_then_upgraded.yml | Update compatibility threshold wire version expectations (min supported). |
| spec/spec_tests/data/sdam/single/compatible.yml | Adjust fixture to represent “compatible” under new support policy. |
| spec/spec_tests/data/sdam/sharded/compatible.yml | Update compatibility threshold wire version expectations (min supported). |
| spec/spec_tests/data/sdam/rs/compatible_unknown.yml | Update compatibility threshold wire version expectations (min supported). |
| spec/spec_tests/data/sdam/rs/compatible.yml | Update compatibility threshold wire version expectations (min supported). |
| spec/spec_tests/data/max_staleness/Single/Incompatible.yml | Remove legacy incompatible max-staleness fixture (unsupported server versions). |
| spec/spec_tests/data/max_staleness/Sharded/Incompatible.yml | Remove legacy incompatible max-staleness fixture (unsupported server versions). |
| spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.yml | Remove legacy incompatible max-staleness fixture (unsupported server versions). |
| spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Incompatible.yml | Remove legacy incompatible max-staleness fixture (unsupported server versions). |
| spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Incompatible.yml | Remove legacy incompatible max-staleness fixture (unsupported server versions). |
| spec/runners/unified.rb | Remove WiredTiger gating for retryable/transaction unified suites. |
| spec/runners/transactions/test.rb | Simplify transaction runner context/session handling and failpoint cleanup gating. |
| spec/runners/server_selection.rb | Remove max-staleness feature stub in server selection runner. |
| spec/runners/crud/requirement.rb | Remove CSFLE FCV gating (now always satisfied by supported servers). |
| spec/mongo/socket/ssl_spec.rb | Update Ruby version note for key-type error behavior. |
| spec/mongo/session_transaction_spec.rb | Remove legacy min FCV and sharded <4.2 transaction error test. |
| spec/mongo/session_spec.rb | Remove min FCV gating for sessions. |
| spec/mongo/session/session_pool_spec.rb | Remove min FCV gating for session pool specs. |
| spec/mongo/server_spec.rb | Simplify retry_writes? specs to remove legacy version branches. |
| spec/mongo/server_selector_spec.rb | Remove max-staleness feature stub. |
| spec/mongo/server/description/features_spec.rb | Remove specs for legacy feature predicates and deprecated wire versions. |
| spec/mongo/server/connection_spec.rb | Remove min server gating in auth-related connection behavior. |
| spec/mongo/server/connection_auth_spec.rb | Remove legacy mechanism negotiation cases and feature stubbing. |
| spec/mongo/retryable_spec.rb | Update non-retryable exception expectations to reflect removed legacy cases. |
| spec/mongo/operation/update/op_msg_spec.rb | Remove min FCV checks and legacy session stubs in OP_MSG specs. |
| spec/mongo/operation/insert/op_msg_spec.rb | Remove legacy session feature stub in OP_MSG insert spec. |
| spec/mongo/operation/delete/op_msg_spec.rb | Remove legacy session feature stub in OP_MSG delete spec. |
| spec/mongo/operation/create/op_msg_spec.rb | Remove legacy session feature stub in OP_MSG create spec. |
| spec/mongo/index/view_spec.rb | Remove legacy version branches and simplify hidden/collation/writeConcern expectations. |
| spec/mongo/error/parser_spec.rb | Remove legacy parser option expectations. |
| spec/mongo/error/operation_failure_heavy_spec.rb | Remove min FCV gating (failpoint constraints now assumed met). |
| spec/mongo/database_spec.rb | Remove legacy server branches and simplify listCollections expectations. |
| spec/mongo/cursor_spec.rb | Remove legacy session gates and dead commented behavior. |
| spec/mongo/cursor/builder/op_get_more_spec.rb | Remove obsolete commented-out legacy tests. |
| spec/mongo/cursor/builder/get_more_command_spec.rb | Remove obsolete commented-out legacy tests. |
| spec/mongo/crypt/auto_encrypter_spec.rb | Remove min FCV gating for auto-encryption tests. |
| spec/mongo/collection_spec.rb | Simplify read preference contexts and remove change stream gating. |
| spec/mongo/collection_ddl_spec.rb | Remove WiredTiger gating in session-related DDL tests. |
| spec/mongo/collection/view_spec.rb | Remove legacy cursor id workaround and collation unsupported branches. |
| spec/mongo/collection/view/readable_spec.rb | Remove legacy read concern/collation unsupported branches. |
| spec/mongo/collection/view/map_reduce_spec.rb | Switch to Deprecations.warn, add recording logger, and remove legacy branches. |
| spec/mongo/collection/view/iterable_spec.rb | Remove obsolete legacy iterable spec file. |
| spec/mongo/collection/view/explainable_spec.rb | Simplify explain tests by removing 2.6/3.0-era branches. |
| spec/mongo/collection/view/change_stream_spec.rb | Remove legacy server split; keep single expected error behavior. |
| spec/mongo/collection/view/change_stream_resume_spec.rb | Remove legacy session/wt gating. |
| spec/mongo/collection/view/builder/op_query_spec.rb | Remove obsolete commented-out legacy tests. |
| spec/mongo/collection/view/builder/find_command_spec.rb | Remove obsolete commented-out legacy tests. |
| spec/mongo/collection/view/aggregation_spec.rb | Remove legacy collation unsupported branches and simplify explain result extraction. |
| spec/mongo/cluster_spec.rb | Remove session support branches for legacy servers; assert support consistently. |
| spec/mongo/client_spec.rb | Remove legacy session/version gating and unsupported session tests. |
| spec/mongo/client_construction_spec.rb | Remove legacy compression/server_api and read concern/version branches. |
| spec/mongo/auth/user/view_spec.rb | Remove compression/version gates; simplify write concern error version gate. |
| spec/mongo/auth/scram_spec.rb | Remove server version gating for SCRAM variants and compression. |
| spec/mongo/auth/scram_negotiation_spec.rb | Remove min FCV gating. |
| spec/mongo/auth/cr_spec.rb | Remove obsolete MongoDB-CR auth spec file. |
| spec/integration/zstd_compression_spec.rb | Remove min server gating for zstd tests. |
| spec/integration/transactions_examples_spec.rb | Remove WiredTiger gating (transaction support macro remains). |
| spec/integration/transactions_api_examples_spec.rb | Remove WiredTiger gating (transaction support macro remains). |
| spec/integration/transaction_pinning_spec.rb | Remove min FCV gating. |
| spec/integration/step_down_spec.rb | Remove version gating in election tuning and “not master” test variants. |
| spec/integration/server_selection_spec.rb | Remove min server gating tied to 2.6-era limitations. |
| spec/integration/server_description_spec.rb | Remove min FCV gating. |
| spec/integration/sdam_error_handling_spec.rb | Remove 4.0/4.2 split; assume modern pool clearing behavior. |
| spec/integration/retryable_writes_errors_spec.rb | Remove mmapv1 retryable writes scenario and legacy version gates. |
| spec/integration/retryable_writes/shared/performs_no_retries.rb | Remove min FCV gating tied to failCommand constraints. |
| spec/integration/retryable_writes/retryable_writes.rb | Remove WiredTiger gating. |
| spec/integration/retryable_reads_errors_spec.rb | Remove min server gating. |
| spec/integration/retryable_errors_spec.rb | Remove legacy failpoint/min FCV and wired tiger on 3.6 gates. |
| spec/integration/read_preference_spec.rb | Remove pre-OP_MSG branch; keep single expected behavior. |
| spec/integration/read_concern_spec.rb | Remove min server gating. |
| spec/integration/query_cache_transactions_spec.rb | Remove WiredTiger gating. |
| spec/integration/query_cache_spec.rb | Remove legacy read concern/collation/$merge version gates. |
| spec/integration/operation_failure_message_spec.rb | Remove legacy server branches; always assert code+codeName formatting. |
| spec/integration/operation_failure_code_spec.rb | Update codeName expectation comments for remaining supported versions. |
| spec/integration/mongos_pinning_spec.rb | Remove min FCV gating. |
| spec/integration/mmapv1_spec.rb | Remove obsolete mmapv1 marker spec. |
| spec/integration/map_reduce_spec.rb | Remove legacy read pref/session gating tied to pre-3.6 behavior. |
| spec/integration/get_more_spec.rb | Remove min FCV gating. |
| spec/integration/docs_examples_spec.rb | Remove min FCV gating for aggregation example. |
| spec/integration/cursor_reaping_spec.rb | Remove legacy min FCV branch; keep single expected killCursors behavior. |
| spec/integration/crud_spec.rb | Remove legacy allowDiskUse/readConcern/version-gated $type numeric expectations. |
| spec/integration/connection_spec.rb | Remove min FCV gating and legacy SDAM/handshake commentary. |
| spec/integration/connection_pool_populator_spec.rb | Remove legacy min server gating. |
| spec/integration/command_spec.rb | Remove min FCV gating and legacy payload shape branching. |
| spec/integration/command_monitoring_spec.rb | Remove pre-3.6 branch; assert hello-based monitoring behavior only. |
| spec/integration/client_update_spec.rb | Remove min FCV gating for auto-encryption option updates. |
| spec/integration/client_side_operations_timeout/encryption_prose_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/views_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/unique_index_on_key_alt_names_prose_spec.rb | Remove min FCV gating (server version constraint remains). |
| spec/integration/client_side_encryption/kms_tls_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/kms_tls_options_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/kms_retry_prose_spec.rb | Remove min server gating. |
| spec/integration/client_side_encryption/external_key_vault_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/decryption_events_prose_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/data_key_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/custom_endpoint_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/corpus_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/client_close_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/bypass_mongocryptd_spawn_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/bson_size_limit_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encrypter_type_conversion_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encryption_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encryption_reconnect_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encryption_old_wire_version_spec.rb | Remove obsolete <4.2 auto-encryption behavior spec. |
| spec/integration/client_side_encryption/auto_encryption_mongocryptd_spawn_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb | Remove min FCV gating. |
| spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb | Remove min FCV gating. |
| spec/integration/client_construction_spec.rb | Remove min FCV gating for auto-encryption construction specs. |
| spec/integration/change_stream_spec.rb | Remove legacy FCV/WiredTiger gates and version splits in resume token tests. |
| spec/integration/change_stream_examples_spec.rb | Remove legacy FCV/WiredTiger gates. |
| spec/integration/bulk_write_spec.rb | Remove pre-3.6 bulk split expectations; assert modern behavior only. |
| spec/integration/bulk_insert_spec.rb | Remove min FCV gating. |
| spec/integration/auth_spec.rb | Remove legacy SCRAM version splits and simplify related comments/gates. |
| spec/USERS.md | Update documentation to reflect SCRAM-only user credential mechanisms. |
| lib/mongo/session.rb | Remove legacy version references; simplify transactions support checks. |
| lib/mongo/server_selector/base.rb | Remove max-staleness validation for legacy servers. |
| lib/mongo/server/pending_connection.rb | Update auth negotiation commentary and default mechanism handling. |
| lib/mongo/server/description/features.rb | Raise DRIVER_WIRE_VERSIONS to 8..25 and drop deprecated wire versions. |
| lib/mongo/server/description.rb | Refactor server_version_gte? version-to-wire mapping logic. |
| lib/mongo/server/connection.rb | Remove OP_QUERY ping path and always use OP_MSG ping. |
| lib/mongo/server/app_metadata.rb | Remove server-version-specific doc references in option docs. |
| lib/mongo/server.rb | Remove sessions_enabled? dependency in retryable reads/writes checks. |
| lib/mongo/retryable/write_worker.rb | Remove mmapv1 actionable retryable-writes error rewriting. |
| lib/mongo/protocol/msg.rb | Remove OP_MSG server-version note in documentation. |
| lib/mongo/protocol/message.rb | Replace legacy server-api error with NotImplementedError base behavior. |
| lib/mongo/operation/write_command/op_msg.rb | Remove legacy option validation module and simplify writeConcern handling. |
| lib/mongo/operation/update/op_msg.rb | Remove legacy update validation call path. |
| lib/mongo/operation/update/bulk_result.rb | Remove legacy comment about nModified on very old servers. |
| lib/mongo/operation/shared/write.rb | Always use OP_MSG write execution path. |
| lib/mongo/operation/shared/validatable.rb | Remove legacy feature-validation module. |
| lib/mongo/operation/shared/specifiable.rb | Remove collation feature gate (assumed supported). |
| lib/mongo/operation/shared/sessions_supported.rb | Remove sessions_enabled? conditional around session application. |
| lib/mongo/operation/shared/result/use_legacy_error_parser.rb | Remove legacy error parser wrapper. |
| lib/mongo/operation/result.rb | Remove legacy error parser require; add TODO about nil replies. |
| lib/mongo/operation/find/builder/command.rb | Remove collation feature check for legacy servers. |
| lib/mongo/operation/distinct/op_msg.rb | Remove outdated “collation always supported on 3.6+” comment. |
| lib/mongo/operation/delete/op_msg.rb | Remove legacy hint validation gate. |
| lib/mongo/operation/create_index/op_msg.rb | Update comments to remove legacy 3.4-era framing. |
| lib/mongo/operation/create/op_msg.rb | Remove outdated “collation always supported on 3.6+” comment. |
| lib/mongo/index/view.rb | Remove legacy server-version notes in docs. |
| lib/mongo/error/unsupported_collation.rb | Remove default message plumbing tied to legacy server feature support. |
| lib/mongo/error/unsupported_array_filters.rb | Remove default message plumbing tied to legacy server feature support. |
| lib/mongo/error/transactions_not_supported.rb | Update doc comment to remove legacy version reasons. |
| lib/mongo/error/server_api_not_supported.rb | Remove legacy error class for pre-3.6 server API support. |
| lib/mongo/error/parser.rb | Remove legacy-mode documentation and legacy option behavior. |
| lib/mongo/error/operation_failure.rb | Remove legacy mmapv1 retryable-write detection helper. |
| lib/mongo/error/invalid_server_preference.rb | Remove legacy max-staleness “<3.4 server” error constant. |
| lib/mongo/error.rb | Remove legacy error field constants and legacy error requires. |
| lib/mongo/database/view.rb | Remove legacy listCollections name-prefix handling; simplify filtering. |
| lib/mongo/database.rb | Remove version-specific change stream doc notes. |
| lib/mongo/cursor.rb | Remove legacy to_return and stop passing to_return in getMore spec. |
| lib/mongo/collection/view/readable.rb | Remove version-specific notes in deprecation docs. |
| lib/mongo/collection/view/map_reduce.rb | Switch to Deprecations.warn and adjust reroute warning formatting. |
| lib/mongo/collection/view/iterable.rb | Simplify cached query slicing logic in iteration. |
| lib/mongo/collection/view/explainable.rb | Remove legacy 2.6 verbose option docs; simplify verbosity docs. |
| lib/mongo/collection/view/change_stream.rb | Remove legacy startAtOperationTime support caching and version docs. |
| lib/mongo/collection.rb | Remove version-specific change stream doc notes. |
| lib/mongo/client.rb | Remove version-specific change stream doc notes; simplify docs. |
| lib/mongo/bulk_write/unordered_combiner.rb | Reorder includes. |
| lib/mongo/bulk_write.rb | Remove legacy feature validation and update hint/version commentary. |
| lib/mongo/auth/stringprep.rb | Remove server-version note from SCRAM-SHA-256 stringprep docs. |
| lib/mongo/auth/conversation_base.rb | Always build OP_MSG auth messages when a connection is present. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR removes driver support for MongoDB versions 3.6 and 4.0.