Skip to content

RUST-803 Conditionally use hello for monitoring #600

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

Merged

Conversation

patrickfreed
Copy link
Contributor

RUST-803

This PR updates the monitors in the driver to make use of helloOk, a new (in 4.4.5) flag to the legacy hello command which can be used to determine if the server supports the new hello command. If it echos back helloOk: true, all subsequent monitor checks should use hello instead of the legacy hello command. The initial check needs to always be legacy though in case the server doesn't support the newer one.

The SDAM tests were synced as part of this.

There are a few remaining instances of the legacy hello command in the driver, all used for initial information requests or for deserialization purposes.

@patrickfreed patrickfreed marked this pull request as ready for review March 22, 2022 21:13
@patrickfreed
Copy link
Contributor Author

Oh I just realized the grep I was using missed a lot of the legacy hellos, will push a new commit that fixes those.

@@ -82,14 +82,10 @@ impl TestClient {
.await;
session.mark_dirty();

let is_master =
RunCommand::new("admin".into(), doc! { "isMaster": 1 }, None, None).unwrap();
let hello = RunCommand::new("admin".into(), doc! { "isMaster": 1 }, None, None).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be using "hello"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one I thought was required, since it's essentially an initial handshake. I realized that I can just reuse the hello_command method though, so I've updated it to that.


#[cfg_attr(feature = "tokio-runtime", tokio::test)]
#[cfg_attr(feature = "async-std-runtime", async_std::test)]
async fn basic() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this test seemed to be sufficiently covered by our end-to-end integration tests and is a bit too specific to the implementation, so I just decided to remove it rather than try to accommodate any more changes to it.

Copy link
Contributor

@kmahar kmahar left a comment

Choose a reason for hiding this comment

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

couple small things but LGTM otherwise

Copy link
Contributor

@abr-egn abr-egn left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@kmahar kmahar left a comment

Choose a reason for hiding this comment

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

lgtm!

@patrickfreed patrickfreed merged commit d55c079 into mongodb:master Mar 24, 2022
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