Skip to content

Commit b1d4e5b

Browse files
authored
feat: add minimum changes for LB support (#1001)
Add a driver version that supports LB mode, and a hack to work around existing known issues. Also, as a drive-by fix, disable RHEL 8.0 s390x testing until the hosts are more reliable.
1 parent 647f031 commit b1d4e5b

File tree

8 files changed

+34
-29
lines changed

8 files changed

+34
-29
lines changed

.evergreen.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,9 +1544,8 @@ buildvariants:
15441544
run_on: rhel72-zseries-small
15451545
tasks:
15461546
- name: e2e_tests_linux_s390x
1547-
# TODO: reenable once /opt/mongodbtoolchain/v3 contains executables that
1548-
# are actually compatible with the OS/architecture:
1549-
# https://jira.mongodb.org/browse/BUILD-13551
1547+
# TODO: Re-enable once RHEL 8.0 distros are ready for use
1548+
# (see also pkg_smoke_tests_rhel80_s390x)
15501549
# - name: e2e_rhel80_s390x
15511550
# display_name: "RHEL 8.0 s390x (E2E Tests)"
15521551
# run_on: rhel80-zseries-small
@@ -1643,11 +1642,11 @@ buildvariants:
16431642
run_on: rhel72-zseries-small
16441643
tasks:
16451644
- name: pkg_test_s390x_rpm
1646-
- name: pkg_smoke_tests_rhel80_s390x
1647-
display_name: "package smoke tests (RHEL 8.0 s390x)"
1648-
run_on: rhel80-zseries-small
1649-
tasks:
1650-
- name: pkg_test_s390x_rpm
1645+
#- name: pkg_smoke_tests_rhel80_s390x
1646+
# display_name: "package smoke tests (RHEL 8.0 s390x)"
1647+
# run_on: rhel80-zseries-small
1648+
# tasks:
1649+
# - name: pkg_test_s390x_rpm
16511650
- name: pkg_smoke_tests_rhel81_ppc64le
16521651
display_name: "package smoke tests (RHEL 8.1 ppc64le)"
16531652
run_on: rhel81-power8-small

package-lock.json

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"karma-typescript": "^5.5.1",
120120
"lerna": "^4.0.0",
121121
"mocha": "^7.1.2",
122-
"mongodb": "4.0.0-beta.6",
122+
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
123123
"mongodb-download-url": "^1.0.1",
124124
"mongodb-js-precommit": "^2.0.0",
125125
"nock": "^13.0.11",

packages/service-provider-core/package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@mongosh/errors": "0.0.0-dev.0",
3131
"@mongosh/i18n": "0.0.0-dev.0",
3232
"bson": "^4.4.1",
33-
"mongodb": "4.0.0-beta.6",
33+
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
3434
"mongodb-build-info": "^1.2.0",
3535
"mongodb-connection-string-url": "^1.0.0"
3636
},

packages/service-provider-server/package-lock.json

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@mongosh/service-provider-core": "0.0.0-dev.0",
4343
"@mongosh/types": "0.0.0-dev.0",
4444
"@types/sinon-chai": "^3.2.3",
45-
"mongodb": "4.0.0-beta.6",
45+
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
4646
"saslprep": "mongodb-js/saslprep#v1.0.4",
4747
"mongodb-connection-string-url": "^1.0.0"
4848
},

packages/service-provider-server/src/cli-service-provider.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,15 @@ export async function connectMongoClient(uri: string, clientOptions: MongoClient
284284
}
285285
}
286286
uri = await resolveMongodbSrv(uri, bus);
287+
if (uri.startsWith('mongodb://') || uri.startsWith('mongodb+srv://')) {
288+
// Hack for Load Balancer support until the driver side is finished:
289+
const cs = new ConnectionString(uri);
290+
if (cs.searchParams.get('loadBalanced') === 'true' &&
291+
!cs.searchParams.has('maxPoolSize')) {
292+
cs.searchParams.set('maxPoolSize', '1');
293+
uri = cs.href;
294+
}
295+
}
287296
const client = new MClient(uri, clientOptions);
288297
await connectWithFailFast(client, bus);
289298
return client;

0 commit comments

Comments
 (0)