Skip to content

Commit 779b3d9

Browse files
committed
PYTHON-5248 - Mark Server version 4.0 as EOL
1 parent 2759379 commit 779b3d9

24 files changed

+252
-624
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 234 additions & 408 deletions
Large diffs are not rendered by default.

.evergreen/generated_configs/variants.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ buildvariants:
146146
COMPRESSOR: zlib
147147
- name: compression-zstd-rhel8
148148
tasks:
149-
- name: .test-standard !.server-4.0
149+
- name: .test-standard !.server-4.2
150150
display_name: Compression zstd RHEL8
151151
run_on:
152152
- rhel87-small
@@ -522,13 +522,6 @@ buildvariants:
522522
PYTHON_BINARY: /opt/python/3.9/bin/python3
523523

524524
# Server version tests
525-
- name: mongodb-v4.0
526-
tasks:
527-
- name: .server-version
528-
display_name: "* MongoDB v4.0"
529-
run_on:
530-
- rhel87-small
531-
tags: [coverage_tag]
532525
- name: mongodb-v4.2
533526
tasks:
534527
- name: .server-version
@@ -684,11 +677,3 @@ buildvariants:
684677
- rhel87-small
685678
expansions:
686679
STORAGE_ENGINE: inmemory
687-
- name: storage-mmapv1-rhel8
688-
tasks:
689-
- name: .test-standard !.sharded_cluster-auth-ssl .server-4.0
690-
display_name: Storage MMAPv1 RHEL8
691-
run_on:
692-
- rhel87-small
693-
expansions:
694-
STORAGE_ENGINE: mmapv1

.evergreen/scripts/generate_config.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
get_task_name,
2626
get_variant_name,
2727
get_versions_from,
28-
get_versions_until,
2928
handle_c_ext,
3029
write_functions_to_file,
3130
write_tasks_to_file,
@@ -196,7 +195,7 @@ def create_compression_variants():
196195
for compressor in "snappy", "zlib", "zstd":
197196
expansions = dict(COMPRESSOR=compressor)
198197
if compressor == "zstd":
199-
tasks = [".test-standard !.server-4.0"]
198+
tasks = [".test-standard !.server-4.2"]
200199
else:
201200
tasks = [".test-standard"]
202201
display_name = get_variant_name(f"Compression {compressor}", host)
@@ -249,16 +248,11 @@ def create_pyopenssl_variants():
249248

250249
def create_storage_engine_variants():
251250
host = DEFAULT_HOST
252-
engines = ["InMemory", "MMAPv1"]
251+
engines = ["InMemory"]
253252
variants = []
254253
for engine in engines:
255254
expansions = dict(STORAGE_ENGINE=engine.lower())
256-
if engine == engines[0]:
257-
tasks = [".test-standard .standalone-noauth-nossl"]
258-
else:
259-
# MongoDB 4.2 drops support for MMAPv1
260-
versions = get_versions_until("4.0")
261-
tasks = [f".test-standard !.sharded_cluster-auth-ssl .server-{v}" for v in versions]
255+
tasks = [".test-standard .standalone-noauth-nossl"]
262256
display_name = get_variant_name(f"Storage {engine}", host)
263257
variant = create_variant(tasks, display_name, host=host, expansions=expansions)
264258
variants.append(variant)

.evergreen/scripts/generate_config_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Globals
2222
##############
2323

24-
ALL_VERSIONS = ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
24+
ALL_VERSIONS = ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
2525
CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
2626
PYPYS = ["pypy3.10"]
2727
ALL_PYTHONS = CPYTHONS + PYPYS

test/__init__.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,6 @@ def _init_client(self):
263263
self.server_status = {}
264264
else:
265265
self.server_status = self.client.admin.command("serverStatus")
266-
if self.storage_engine == "mmapv1":
267-
# MMAPv1 does not support retryWrites=True.
268-
self.default_client_options["retryWrites"] = False
269266

270267
hello = self.hello
271268
self.sessions_enabled = "logicalSessionTimeoutMinutes" in hello
@@ -525,19 +522,6 @@ def require_data_lake(self, func):
525522
func=func,
526523
)
527524

528-
def require_no_mmap(self, func):
529-
"""Run a test only if the server is not using the MMAPv1 storage
530-
engine. Only works for standalone and replica sets; tests are
531-
run regardless of storage engine on sharded clusters.
532-
"""
533-
534-
def is_not_mmap():
535-
if self.is_mongos:
536-
return True
537-
return self.storage_engine != "mmapv1"
538-
539-
return self._require(is_not_mmap, "Storage engine must not be MMAPv1", func=func)
540-
541525
def require_version_min(self, *ver):
542526
"""Run a test only if the server version is at least ``version``."""
543527
other_version = Version(*ver)
@@ -674,7 +658,7 @@ def require_no_serverless(self, func):
674658

675659
def require_change_streams(self, func):
676660
"""Run a test only if the server supports change streams."""
677-
return self.require_no_mmap(self.require_no_standalone(self.require_no_serverless(func)))
661+
return self.require_no_standalone(self.require_no_serverless(func))
678662

679663
def is_topology_type(self, topologies):
680664
unknown = set(topologies) - {
@@ -777,8 +761,6 @@ def require_sessions(self, func):
777761
return self._require(lambda: self.sessions_enabled, "Sessions not supported", func=func)
778762

779763
def supports_retryable_writes(self):
780-
if self.storage_engine == "mmapv1":
781-
return False
782764
if not self.sessions_enabled:
783765
return False
784766
return self.is_mongos or self.is_rs
@@ -792,9 +774,6 @@ def require_retryable_writes(self, func):
792774
)
793775

794776
def supports_transactions(self):
795-
if self.storage_engine == "mmapv1":
796-
return False
797-
798777
if self.version.at_least(4, 1, 8):
799778
return self.is_mongos or self.is_rs
800779

test/asynchronous/__init__.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,6 @@ async def _init_client(self):
263263
self.server_status = {}
264264
else:
265265
self.server_status = await self.client.admin.command("serverStatus")
266-
if self.storage_engine == "mmapv1":
267-
# MMAPv1 does not support retryWrites=True.
268-
self.default_client_options["retryWrites"] = False
269266

270267
hello = await self.hello
271268
self.sessions_enabled = "logicalSessionTimeoutMinutes" in hello
@@ -527,19 +524,6 @@ def require_data_lake(self, func):
527524
func=func,
528525
)
529526

530-
def require_no_mmap(self, func):
531-
"""Run a test only if the server is not using the MMAPv1 storage
532-
engine. Only works for standalone and replica sets; tests are
533-
run regardless of storage engine on sharded clusters.
534-
"""
535-
536-
def is_not_mmap():
537-
if self.is_mongos:
538-
return True
539-
return self.storage_engine != "mmapv1"
540-
541-
return self._require(is_not_mmap, "Storage engine must not be MMAPv1", func=func)
542-
543527
def require_version_min(self, *ver):
544528
"""Run a test only if the server version is at least ``version``."""
545529
other_version = Version(*ver)
@@ -676,7 +660,7 @@ def require_no_serverless(self, func):
676660

677661
def require_change_streams(self, func):
678662
"""Run a test only if the server supports change streams."""
679-
return self.require_no_mmap(self.require_no_standalone(self.require_no_serverless(func)))
663+
return self.require_no_standalone(self.require_no_serverless(func))
680664

681665
async def is_topology_type(self, topologies):
682666
unknown = set(topologies) - {
@@ -779,8 +763,6 @@ def require_sessions(self, func):
779763
return self._require(lambda: self.sessions_enabled, "Sessions not supported", func=func)
780764

781765
def supports_retryable_writes(self):
782-
if self.storage_engine == "mmapv1":
783-
return False
784766
if not self.sessions_enabled:
785767
return False
786768
return self.is_mongos or self.is_rs
@@ -794,9 +776,6 @@ def require_retryable_writes(self, func):
794776
)
795777

796778
def supports_transactions(self):
797-
if self.storage_engine == "mmapv1":
798-
return False
799-
800779
if self.version.at_least(4, 1, 8):
801780
return self.is_mongos or self.is_rs
802781

test/asynchronous/test_cursor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,6 @@ async def test_get_item(self):
16001600
async def test_collation(self):
16011601
await anext(self.db.test.find_raw_batches(collation=Collation("en_US")))
16021602

1603-
@async_client_context.require_no_mmap # MMAPv1 does not support read concern
16041603
async def test_read_concern(self):
16051604
await self.db.get_collection("test", write_concern=WriteConcern(w="majority")).insert_one(
16061605
{}

test/asynchronous/test_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ async def callback(session):
11621162

11631163
class TestCausalConsistencyExamples(AsyncIntegrationTest):
11641164
@async_client_context.require_secondaries_count(1)
1165-
@async_client_context.require_no_mmap
11661165
async def test_causal_consistency(self):
11671166
# Causal consistency examples
11681167
client = self.client

test/asynchronous/test_retryable_writes.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -141,40 +141,10 @@ async def asyncTearDown(self) -> None:
141141
self.deprecation_filter.stop()
142142

143143

144-
class TestRetryableWritesMMAPv1(IgnoreDeprecationsTest):
145-
knobs: client_knobs
146-
147-
async def asyncSetUp(self) -> None:
148-
await super().asyncSetUp()
149-
# Speed up the tests by decreasing the heartbeat frequency.
150-
self.knobs = client_knobs(heartbeat_frequency=0.1, min_heartbeat_interval=0.1)
151-
self.knobs.enable()
152-
self.client = await self.async_rs_or_single_client(retryWrites=True)
153-
self.db = self.client.pymongo_test
154-
155-
async def asyncTearDown(self) -> None:
156-
self.knobs.disable()
157-
158-
@async_client_context.require_no_standalone
159-
async def test_actionable_error_message(self):
160-
if async_client_context.storage_engine != "mmapv1":
161-
raise SkipTest("This cluster is not running MMAPv1")
162-
163-
expected_msg = (
164-
"This MongoDB deployment does not support retryable "
165-
"writes. Please add retryWrites=false to your "
166-
"connection string."
167-
)
168-
for method, args, kwargs in retryable_single_statement_ops(self.db.retryable_write_test):
169-
with self.assertRaisesRegex(OperationFailure, expected_msg):
170-
await method(*args, **kwargs)
171-
172-
173144
class TestRetryableWrites(IgnoreDeprecationsTest):
174145
listener: OvertCommandListener
175146
knobs: client_knobs
176147

177-
@async_client_context.require_no_mmap
178148
async def asyncSetUp(self) -> None:
179149
await super().asyncSetUp()
180150
# Speed up the tests by decreasing the heartbeat frequency.
@@ -427,7 +397,6 @@ class TestWriteConcernError(AsyncIntegrationTest):
427397
fail_insert: dict
428398

429399
@async_client_context.require_replica_set
430-
@async_client_context.require_no_mmap
431400
@async_client_context.require_failCommand_fail_point
432401
async def asyncSetUp(self) -> None:
433402
await super().asyncSetUp()
@@ -599,7 +568,6 @@ async def test_returns_original_error_code(
599568
# TODO: Make this a real integration test where we stepdown the primary.
600569
class TestRetryableWritesTxnNumber(IgnoreDeprecationsTest):
601570
@async_client_context.require_replica_set
602-
@async_client_context.require_no_mmap
603571
async def test_increment_transaction_id_without_sending_command(self):
604572
"""Test that the txnNumber field is properly incremented, even when
605573
the first attempt fails before sending the command.

test/asynchronous/test_session.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,6 @@ async def test_server_not_causal(self):
10951095
self.assertIsNone(act)
10961096

10971097
@async_client_context.require_no_standalone
1098-
@async_client_context.require_no_mmap
10991098
async def test_read_concern(self):
11001099
async with self.client.start_session(causal_consistency=True) as s:
11011100
coll = self.client.pymongo_test.test

0 commit comments

Comments
 (0)