Skip to content

feat(NODE-2992): consider server load during server selection #3219

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 15 commits into from
Apr 29, 2022

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Apr 26, 2022

Description

What is changing?

This PR updates server selection to consider the number of operations running against a particular server.

  • a new property was added to the server class to keep track of the current number of operations running against a particular server
  • server selection was updated randomly select 2 servers from the latency window, and select the server with the smaller operation count
  • A new prose test was added to ensure that if a server is slowing down, requests are routed to the healthy server
  • tests were added to the server class to ensure that the count is decremented appropriately for each operation
  • a new spec test runner was added to run the latency window spec tests, and the latency window spec tests were synced.
Is there new documentation needed for these changes?

No.

What is the motivation for this change?

This is a part of the avoiding connection storms epic. Keeping track of the current server load will allow server selection to choose servers with fewer request being sent to them and help prevent connection storms.

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>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

remove .only

staging for switch branches

fix: apply localthreshold default of 15ms

test: add integration test for localThresholdMS

remove unit tests

fix test descriptions

test: add test runner && failing as expected

refactor: misc cleanup in new test file

passing unit tests

feat: add new prose test for server selection

add rough prose test

add runonrequirements

here we are

clean up new prose test

add steps to prose test

fix: decrement operation count after failing to checkout a connection

misc changes - prepare for commit

fix up unit tests

wrap up work
@baileympearson baileympearson marked this pull request as ready for review April 27, 2022 14:29
@baileympearson baileympearson requested a review from nbbeeken April 27, 2022 20:12
nbbeeken
nbbeeken previously approved these changes Apr 28, 2022
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM

@nbbeeken nbbeeken requested review from durran and dariakp April 28, 2022 21:11
@nbbeeken nbbeeken added the Team Review Needs review from team label Apr 28, 2022
@nbbeeken nbbeeken removed request for durran and dariakp April 28, 2022 21:30
@dariakp dariakp self-requested a review April 28, 2022 22:09
nbbeeken
nbbeeken previously approved these changes Apr 29, 2022
nbbeeken
nbbeeken previously approved these changes Apr 29, 2022
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@nbbeeken nbbeeken merged commit 35eeba3 into main Apr 29, 2022
@nbbeeken nbbeeken deleted the NODE-2992-consider-server-load-in-server-selection branch April 29, 2022 20:57
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