Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/arsn 371 useunifiedtopology #2179

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/storage/metadata/mongoclient/MongoClientInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class MongoClientInterface {
constructor(params) {
const { replicaSetHosts, writeConcern, replicaSet, readPreference, path,
database, logger, replicationGroupId, authCredentials,
isLocationTransient, shardCollections } = params;
isLocationTransient, shardCollections, useUnifiedTopology } = params;
const cred = MongoUtils.credPrefix(authCredentials);
this.mongoUrl = `mongodb://${cred}${replicaSetHosts}/` +
`?w=${writeConcern}&readPreference=${readPreference}`;
Expand All @@ -108,6 +108,7 @@ class MongoClientInterface {
this.database = database;
this.isLocationTransient = isLocationTransient;
this.shardCollections = shardCollections;
this.useUnifiedTopology = useUnifiedTopology;

this.concurrentCursors = (process.env.CONCURRENT_CURSORS &&
!Number.isNaN(process.env.CONCURRENT_CURSORS))
Expand Down Expand Up @@ -144,6 +145,9 @@ class MongoClientInterface {
socketTimeoutMS,
useNewUrlParser: true,
};
if (this.useUnifiedTopology === true) {
options.useUnifiedTopology = true;
}
if (process.env.MONGO_POOL_SIZE &&
!Number.isNaN(process.env.MONGO_POOL_SIZE)) {
options.poolSize = Number.parseInt(process.env.MONGO_POOL_SIZE, 10);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"engines": {
"node": ">=16"
},
"version": "8.1.113",
"version": "8.1.114",
"description": "Common utilities for the S3 project components",
"main": "build/index.js",
"repository": {
Expand Down