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

fix: adds topology discovery for mongos #2557

Merged
merged 6 commits into from
Oct 13, 2020
Merged

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Sep 30, 2020

@@ -687,6 +687,8 @@ function parseConnectionString(uri, options, callback) {
return callback(new MongoParseError('directConnection option requires exactly one host'));
}

parsedOptions._directConnection = Boolean(parsedOptions.directConnection);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open changing the naming here, we need a way to know if directConnect is defaulted to true or not.

@@ -687,6 +687,8 @@ function parseConnectionString(uri, options, callback) {
return callback(new MongoParseError('directConnection option requires exactly one host'));
}

parsedOptions._directConnection = Boolean(parsedOptions.directConnection);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the fix here to just remove the code below in the // NOTE section?

Copy link
Contributor Author

@reggi reggi Oct 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reasoning for not removing that code is, this issue was reported in 3.6, I thought we'd want to fix it there not issue a breaking change.

Since changing the starting topology can reasonably be considered a backwards-breaking change, existing drivers SHOULD stage implementation according to semantic versioning guidelines. Specifically, support for the directConnection URI option can be added in a minor release. In a subsequent major release, the default starting topology can be changed to Unknown. Drivers MUST document this in a prior minor release.

server-discovery-and-monitoring.rst

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bug reported in 3.6 using an opt-in feature where we broke compatibility with the existing behavior, I don't think anybody is depending on the bug's behavior. We should just fix it in 3.6 now, and maintain the new behavior as-is in master

@reggi reggi requested a review from mbroadst October 1, 2020 17:15
@reggi reggi force-pushed the NODE-2827/toplology-sharded branch from 3d32864 to 50d6bd1 Compare October 7, 2020 21:43
@reggi reggi requested a review from emadum October 8, 2020 13:48
Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are two SDAM spec tests that are causing CI to fail.

@reggi
Copy link
Contributor Author

reggi commented Oct 9, 2020

Had to update SDAM tests.

Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left two notes about how I think this can be slightly improved, but no need to hold up merging the change

metadata: { requires: { topology: 'sharded' } },
test: function() {
const client = this.configuration.newClient({}, { useUnifiedTopology: true });
expect(client.s.options).to.have.property('useUnifiedTopology', true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer not to observe private properties, I think it's satisfactory to have the check for the topology description type below.

test/functional/sharding_connection.test.js Outdated Show resolved Hide resolved
Thomas Reggi and others added 2 commits October 12, 2020 10:26
@reggi reggi requested a review from emadum October 12, 2020 14:54
@reggi
Copy link
Contributor Author

reggi commented Oct 12, 2020

Looks like there are two SDAM spec tests that are causing CI to fail.

@emadum I don't think it's useful to put in a change request that the tests are failing, because the pull will be blocked by that, I approve PR's all the time that have failing tests I think it's implied. Just a thought here, because now that the tests are passing I'm still blocked by your change request.

@reggi reggi closed this Oct 12, 2020
@reggi reggi reopened this Oct 12, 2020
@emadum
Copy link
Contributor

emadum commented Oct 13, 2020

Looks like there are two SDAM spec tests that are causing CI to fail.

@emadum I don't think it's useful to put in a change request that the tests are failing, because the pull will be blocked by that, I approve PR's all the time that have failing tests I think it's implied. Just a thought here, because now that the tests are passing I'm still blocked by your change request.

That make sense, will do that going forward.

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@reggi reggi merged commit f8fd310 into 3.6 Oct 13, 2020
@reggi reggi deleted the NODE-2827/toplology-sharded branch October 13, 2020 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants