From 78fc0fac3707b14e485052fe548a57c3c28a01d4 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 11 Apr 2023 15:21:21 -0500 Subject: [PATCH 1/3] PYTHON-3652 Bump maxWireVersion for MongoDB 7.0 --- pymongo/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymongo/common.py b/pymongo/common.py index add70cfb5f..707cf5d23f 100644 --- a/pymongo/common.py +++ b/pymongo/common.py @@ -63,7 +63,7 @@ # What this version of PyMongo supports. MIN_SUPPORTED_SERVER_VERSION = "3.6" MIN_SUPPORTED_WIRE_VERSION = 6 -MAX_SUPPORTED_WIRE_VERSION = 17 +MAX_SUPPORTED_WIRE_VERSION = 21 # Frequency to call hello on servers, in seconds. HEARTBEAT_FREQUENCY = 10 From a04e29d61d35748fc722c262336a7991c4d3f8e9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 11 Apr 2023 15:42:34 -0500 Subject: [PATCH 2/3] fix max version check --- test/test_topology.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_topology.py b/test/test_topology.py index d7bae9229f..b86d8a5f72 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -532,6 +532,7 @@ def test_wire_version(self): t.select_servers(any_server_selector) # Incompatible. + max_version = common.MAX_SUPPORTED_WIRE_VERSION got_hello( t, address, @@ -540,8 +541,8 @@ def test_wire_version(self): HelloCompat.LEGACY_CMD: True, "setName": "rs", "hosts": ["a"], - "minWireVersion": 21, - "maxWireVersion": 22, + "minWireVersion": max_version + 1, + "maxWireVersion": max_version + 2, }, ) @@ -551,8 +552,8 @@ def test_wire_version(self): # Error message should say which server failed and why. self.assertEqual( str(e), - "Server at a:27017 requires wire version 21, but this version " - "of PyMongo only supports up to %d." % (common.MAX_SUPPORTED_WIRE_VERSION,), + "Server at a:27017 requires wire version %d, but this version " + "of PyMongo only supports up to %d." % (max_version + 1, max_version), ) else: self.fail("No error with incompatible wire version") From f7ac08ba4333df4634a5b1c1ce7c95bce50ae244 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 12 Apr 2023 10:06:18 -0500 Subject: [PATCH 3/3] address review --- test/test_topology.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/test_topology.py b/test/test_topology.py index b86d8a5f72..e09d7c3691 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -532,7 +532,6 @@ def test_wire_version(self): t.select_servers(any_server_selector) # Incompatible. - max_version = common.MAX_SUPPORTED_WIRE_VERSION got_hello( t, address, @@ -541,8 +540,8 @@ def test_wire_version(self): HelloCompat.LEGACY_CMD: True, "setName": "rs", "hosts": ["a"], - "minWireVersion": max_version + 1, - "maxWireVersion": max_version + 2, + "minWireVersion": 22, + "maxWireVersion": 24, }, ) @@ -552,8 +551,8 @@ def test_wire_version(self): # Error message should say which server failed and why. self.assertEqual( str(e), - "Server at a:27017 requires wire version %d, but this version " - "of PyMongo only supports up to %d." % (max_version + 1, max_version), + "Server at a:27017 requires wire version 22, but this version " + "of PyMongo only supports up to %d." % (common.MAX_SUPPORTED_WIRE_VERSION,), ) else: self.fail("No error with incompatible wire version")