Skip to content

CDRIVER-3997 Use "hello" command for monitoring if supported #797

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
merged 14 commits into from
Jun 22, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented May 26, 2021

CDRIVER-3997

The first commit are squashed changes from #794 which I'll remove before merging this PR. I suggest reviewing this PR commit by commit.

This PR syncs the spec tests to the latest version from mongodb/specifications#990.

@alcaeus alcaeus requested a review from kevinAlbs May 26, 2021 08:37
@alcaeus alcaeus self-assigned this May 26, 2021
@alcaeus alcaeus force-pushed the cdriver-3997 branch 2 times, most recently from f730c4d to 5ccd330 Compare May 26, 2021 09:05
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

I still need to review tests, but I looked at all implementation changes.

@jmikola
Copy link
Member

jmikola commented Jun 7, 2021

@alcaeus I think this PR might be missing some updated spec tests. While syncing spec tests for CDRIVER-3895 I pulled in changes from mongodb/specifications@3385a12. I cross-referenced those changes with a related CDRIVER ticket and ended up here, but noticed that some files (e.g. source/transactions/tests/legacy/error-labels.json) were missing from this PR.

@alcaeus
Copy link
Member Author

alcaeus commented Jun 16, 2021

@jmikola interesting. I'll give the spec tests another look separately from this PR.

@alcaeus
Copy link
Member Author

alcaeus commented Jun 16, 2021

@kevinAlbs the last commit updates the test to ensure that closing the connection after a handshake reverts back to correctly using legacy hello, regardless of whether the server previously responded with helloOk. That should complete this work.

@alcaeus alcaeus requested a review from kevinAlbs June 16, 2021 07:09
@alcaeus
Copy link
Member Author

alcaeus commented Jun 17, 2021

@alcaeus
Copy link
Member Author

alcaeus commented Jun 17, 2021

@jmikola I've synced spec tests one more time with the latest version, which together with your changes from #801 should have all tests up-to-date.

Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

This is looking great! Just a few last comments.

@kevinAlbs I'm at a loss why some builds are failing with a "redundant declaration" warning: evergreen.mongodb.com/task_log_raw/mongo_c_driver_releng_compile_tracing_patch_f1093ba1686b8bf876eed67e0c7f59918649ef15_60cb1b3ca4cf473aac7310aa_21_06_17_09_51_58/0?type=T#L345. Got any pointers for me?

I think moving _mongoc_topology_set_server_api above the last #endif so it is inside the include guard should do the trick.

alcaeus added 2 commits June 18, 2021 11:25
This is not necessary since we don't rely on hello_ok if an API version was declared

This partially reverts commit 7d58f04.
@kevinAlbs kevinAlbs self-requested a review June 21, 2021 19:21
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM!

@alcaeus alcaeus merged commit d261727 into mongodb:master Jun 22, 2021
@alcaeus alcaeus deleted the cdriver-3997 branch June 22, 2021 06:20
alcaeus added a commit that referenced this pull request Jun 22, 2021
* Handle helloOk flag in server description

* Refactor handshake command naming

* Use hello command after seeing helloOk in legacy hello response

* Fix 5.0 test

* Update SDAM spec tests to latest version

* Reset hello_ok in mongoc_server_description_reset only

* Don't update initial server description in server monitor

* Always build legacy_hello_cmd with legacy hello command

* Test fallback to legacy hello after connection is closed

* Update wrong comment

Co-authored-by: Kevin Albertson <[email protected]>

* Don't modify legacy_hello_cmd when using versioned API

* Lock topology mutex before obtaining server description

* Don't update hello_ok when declaring API version

This is not necessary since we don't rely on hello_ok if an API version was declared

This partially reverts commit 7d58f04.

* Remove early return when reconciling scanner nodes

Co-authored-by: Kevin Albertson <[email protected]>
kevinAlbs added a commit to kevinAlbs/mongo-c-driver that referenced this pull request Jul 13, 2021
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.

3 participants