diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 964dfa362f..24ff0ee361 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -291,6 +291,7 @@ functions: DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \ ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \ REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ + LOAD_BALANCER=${LOAD_BALANCER} \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh # run-orchestration generates expansion file with the MONGODB_URI for the cluster - command: expansions.update @@ -1798,6 +1799,7 @@ tasks: - func: "bootstrap mongo-orchestration" vars: TOPOLOGY: "sharded_cluster" + LOAD_BALANCER: true - func: "run load-balancer" - func: "run tests" # }}} @@ -2023,6 +2025,10 @@ axes: display_name: "MongoDB 5.0" variables: VERSION: "5.0" + - id: "rapid" + display_name: "MongoDB rapid" + variables: + VERSION: "rapid" # Choice of Python runtime version - id: python-version @@ -2986,7 +2992,7 @@ buildvariants: - matrix_name: "load-balancer" matrix_spec: platform: awslinux - mongodb-version: ["5.0", "latest"] + mongodb-version: ["rapid", "latest"] auth-ssl: "*" python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "pypy", "pypy3.5", "pypy3.7"] loadbalancer: "*" diff --git a/pymongo/pool.py b/pymongo/pool.py index ff7459747e..758a8a54a5 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -242,9 +242,6 @@ def _set_keepalive_times(sock): # main thread, to avoid the deadlock. See PYTHON-607. u"foo".encode("idna") -# Remove after PYTHON-2712 -_MOCK_SERVICE_ID = False - def _raise_connection_failure(address, error, msg_prefix=None): """Convert a socket.error to ConnectionFailure and raise it.""" @@ -619,12 +616,6 @@ def _hello(self, cluster_time, topology_version, heartbeat_frequency, all_creden cmd["speculativeAuthenticate"] = auth_ctx.speculate_command() doc = self.command("admin", cmd, publish_events=False, exhaust_allowed=awaitable) - # PYTHON-2712 will remove this topologyVersion fallback logic. - if self.opts.load_balanced and _MOCK_SERVICE_ID: - process_id = doc.get("topologyVersion", {}).get("processId") - doc.setdefault("serviceId", process_id) - if not self.opts.load_balanced: - doc.pop("serviceId", None) hello = IsMaster(doc, awaitable=awaitable) self.is_writable = hello.is_writable self.max_wire_version = hello.max_wire_version @@ -661,9 +652,6 @@ def _next_reply(self): unpacked_docs = reply.unpack_response() response_doc = unpacked_docs[0] helpers._check_command_response(response_doc, self.max_wire_version) - # Remove after PYTHON-2712. - if not self.opts.load_balanced: - response_doc.pop("serviceId", None) return response_doc def command( diff --git a/test/__init__.py b/test/__init__.py index 2b2f426215..16171eb670 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -98,11 +98,7 @@ SINGLE_MONGOS_LB_URI = os.environ.get("SINGLE_MONGOS_LB_URI") MULTI_MONGOS_LB_URI = os.environ.get("MULTI_MONGOS_LB_URI") if TEST_LOADBALANCER: - # Remove after PYTHON-2712 - from pymongo import pool - - pool._MOCK_SERVICE_ID = True - res = parse_uri(SINGLE_MONGOS_LB_URI) + res = parse_uri(SINGLE_MONGOS_LB_URI or "") host, port = res["nodelist"][0] db_user = res["username"] or db_user db_pwd = res["password"] or db_pwd