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-5197): add server monitoring mode #3899

Merged
merged 6 commits into from
Nov 14, 2023

Conversation

durran
Copy link
Member

@durran durran commented Oct 19, 2023

Description

Introduces a new serverMonitoringMode flag to tell monitors to stream, poll, or auto-detect.

What is changing?

  • Updates FaaS automated tests to assert that no awaited=true flags are set on the server heartbeat started events.
  • Adds serverMonitoringMode (stream|poll|auto) to URI options and MongoClientOptions
  • Updates monitor behaviour to poll or stream based on options or environment.
  • Ensures dedicated connection is used for RTT pinging in polling mode.
  • Updates Unified test runner to work with schema 1.17
  • Syncs SDAM unified tests
  • Syncs URI options tests
Is there new documentation needed for these changes?

Yes, we must document the new option.

What is the motivation for this change?

NODE-5197

Release Highlight

New client option serverMonitoringMode added.

For users that want to control the behaviour of the monitoring connection between each node in the topology, a new option, serverMonitoringMode, has been added. This defaults to auto but can be forced into a specific mode by providing a value of poll or stream. A polling monitor periodically issues a hello command to the node at an interval of heartbeatFrequencyMS. A streaming monitor sends an initial hello and then will automatically get a response from the Node when a change in server configuration occurs or at a maximum time of heartbeatFrequencyMS. The value of that option defaults to 10000 milliseconds.

This new option can be provided in the connection string or as an option to the MongoClient.

// In the connection string.
new MongoClient('mongodb://127.0.0.1:27017/?serverMonitoringMode=stream');

// In the options
new MongoClient('mongodb://127.0.0.1:27017/', { serverMonitoringMode: 'stream' });

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

@durran durran force-pushed the NODE-5197-server-monitoring-mode branch 9 times, most recently from 1c716c0 to 5b730ca Compare October 20, 2023 13:09
@durran durran force-pushed the NODE-5197-server-monitoring-mode branch 3 times, most recently from d53c18d to 7a79b6c Compare November 6, 2023 19:10
@durran durran force-pushed the NODE-5197-server-monitoring-mode branch from 7a79b6c to 94b4957 Compare November 6, 2023 19:29
@durran durran force-pushed the NODE-5197-server-monitoring-mode branch from 94b4957 to b8b5173 Compare November 6, 2023 20:16
@durran durran marked this pull request as ready for review November 6, 2023 21:08
@W-A-James W-A-James self-requested a review November 8, 2023 19:43
@W-A-James W-A-James self-assigned this Nov 8, 2023
@W-A-James W-A-James added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 8, 2023
src/sdam/monitor.ts Show resolved Hide resolved
test/lambda/mongodb/app.mjs Outdated Show resolved Hide resolved
src/sdam/monitor.ts Outdated Show resolved Hide resolved
src/mongo_client.ts Outdated Show resolved Hide resolved
@durran durran requested a review from W-A-James November 9, 2023 14:54
W-A-James
W-A-James previously approved these changes Nov 9, 2023
@W-A-James W-A-James added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Nov 9, 2023
src/sdam/monitor.ts Outdated Show resolved Hide resolved
test/lambda/mongodb/package.json Outdated Show resolved Hide resolved
@durran durran requested a review from nbbeeken November 14, 2023 18:58
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
Development

Successfully merging this pull request may close these issues.

3 participants