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

feat(NODE-3689): require hello command for connection handshake to use OP_MSG disallowing OP_QUERY #3938

Merged
merged 17 commits into from Dec 6, 2023

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented Nov 30, 2023

Description

Always perform the initial handshake as hello + OP_MSG in the load-balanced mode or when serverApi is specified.

What is changing?

  • The driver already sends the hello command in the load-balanced mode and when the server API is specified (see NODE-3881)
  • Previously we were checking only for the load-balanced topology to send the initial handshake as OP_MSG, now we also check for serverApi.version (see spec)
  • This PR adds integration tests for both the load-balanced mode and server API to verify that:
    • In the load-balanced mode, the initial handshake is always sent as OP_MSG
    • When the server API is specified, the initial handshake is always sent as OP_MSG
    • When neither load-balanced nor server API, the initial handshake is always sent as OP_QUERY, but eventually switched to OP_MSG
  • Change some clients to mocked servers configured with an API version to not set a serverApi, because mocked servers do not support OP_MSG and fail when run on latest_server_v1_api. There is the existing ticket to remove usage of mongodb mock server (NODE-3807).
Is there new documentation needed for these changes?

No

What is the motivation for this change?

NODE-3689

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@alenakhineika alenakhineika marked this pull request as ready for review December 1, 2023 20:55
src/utils.ts Outdated Show resolved Hide resolved
test/unit/cmap/connection.test.ts Outdated Show resolved Hide resolved
test/unit/cmap/connection.test.ts Outdated Show resolved Hide resolved
@durran durran self-assigned this Dec 4, 2023
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Dec 4, 2023
@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Dec 5, 2023
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

@durran durran merged commit ce7df0f into main Dec 6, 2023
26 checks passed
@durran durran deleted the NODE-3689-require-hello-plus-op-msg branch December 6, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
4 participants