Skip to content

Commit

Permalink
feat: add minimum changes for LB support (#1001)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
addaleax authored Jul 8, 2021
1 parent 647f031 commit b1d4e5b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 29 deletions.
15 changes: 7 additions & 8 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,8 @@ buildvariants:
run_on: rhel72-zseries-small
tasks:
- name: e2e_tests_linux_s390x
# TODO: reenable once /opt/mongodbtoolchain/v3 contains executables that
# are actually compatible with the OS/architecture:
# https://jira.mongodb.org/browse/BUILD-13551
# TODO: Re-enable once RHEL 8.0 distros are ready for use
# (see also pkg_smoke_tests_rhel80_s390x)
# - name: e2e_rhel80_s390x
# display_name: "RHEL 8.0 s390x (E2E Tests)"
# run_on: rhel80-zseries-small
Expand Down Expand Up @@ -1643,11 +1642,11 @@ buildvariants:
run_on: rhel72-zseries-small
tasks:
- name: pkg_test_s390x_rpm
- name: pkg_smoke_tests_rhel80_s390x
display_name: "package smoke tests (RHEL 8.0 s390x)"
run_on: rhel80-zseries-small
tasks:
- name: pkg_test_s390x_rpm
#- name: pkg_smoke_tests_rhel80_s390x
# display_name: "package smoke tests (RHEL 8.0 s390x)"
# run_on: rhel80-zseries-small
# tasks:
# - name: pkg_test_s390x_rpm
- name: pkg_smoke_tests_rhel81_ppc64le
display_name: "package smoke tests (RHEL 8.1 ppc64le)"
run_on: rhel81-power8-small
Expand Down
17 changes: 8 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"karma-typescript": "^5.5.1",
"lerna": "^4.0.0",
"mocha": "^7.1.2",
"mongodb": "4.0.0-beta.6",
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
"mongodb-download-url": "^1.0.1",
"mongodb-js-precommit": "^2.0.0",
"nock": "^13.0.11",
Expand Down
5 changes: 2 additions & 3 deletions packages/service-provider-core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/service-provider-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@mongosh/errors": "0.0.0-dev.0",
"@mongosh/i18n": "0.0.0-dev.0",
"bson": "^4.4.1",
"mongodb": "4.0.0-beta.6",
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
"mongodb-build-info": "^1.2.0",
"mongodb-connection-string-url": "^1.0.0"
},
Expand Down
11 changes: 5 additions & 6 deletions packages/service-provider-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/service-provider-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/types": "0.0.0-dev.0",
"@types/sinon-chai": "^3.2.3",
"mongodb": "4.0.0-beta.6",
"mongodb": "addaleax/node-mongodb-native#71d4c39e5c858f49d10e840df626eca4da653e28",
"saslprep": "mongodb-js/saslprep#v1.0.4",
"mongodb-connection-string-url": "^1.0.0"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/service-provider-server/src/cli-service-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,15 @@ export async function connectMongoClient(uri: string, clientOptions: MongoClient
}
}
uri = await resolveMongodbSrv(uri, bus);
if (uri.startsWith('mongodb://') || uri.startsWith('mongodb+srv://')) {
// Hack for Load Balancer support until the driver side is finished:
const cs = new ConnectionString(uri);
if (cs.searchParams.get('loadBalanced') === 'true' &&
!cs.searchParams.has('maxPoolSize')) {
cs.searchParams.set('maxPoolSize', '1');
uri = cs.href;
}
}
const client = new MClient(uri, clientOptions);
await connectWithFailFast(client, bus);
return client;
Expand Down

0 comments on commit b1d4e5b

Please sign in to comment.