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

Remerge cnode selection #1076

Merged
merged 8 commits into from Nov 24, 2020
Merged

Remerge cnode selection #1076

merged 8 commits into from Nov 24, 2020

Conversation

vicky-g
Copy link
Contributor

@vicky-g vicky-g commented Nov 24, 2020

Trello Card Link

https://trello.com/c/eVKqXcKS/1639-add-creator-node-selection-logic

Description

On 11/16/2020, the original, updated Content Node selection PR was reverted. This was because although the new selection logic in libs had been published and released, the selection logic also relied on some new fields in Content Node's /health_check route that was also included in the original PR. However, the Content Node was not released with the new data in the /health_check route. This caused the cnode selection to fail, and thus preventing uploads from successfully working.

The purpose of this PR is to:

  • Reinstate the Content Node selection logic
    • In contrast to the original PR, we will not check /health_check for the geographic location. We will instead check for /version, as this endpoint already contains the version info and geographic info.
    • This switch will allow for backwards compatibility for those services that are behind in version
  • Add another route at the path /health_check/verbose to include the original /health_check data, as well as geographic data.
    • This route will also contain future information regarding the Content Node like disk usage, current load, and other criteria to determine whether it should or should not be selected
    • In the future, we can switch to using this new route and eventually deprecate /version
  • Light refactoring
    • if service is currently syncing, set as unhealthy
    • update tests to reflect changes

Services

  • Discovery Provider
  • Creator Node
  • Identity Service
  • Libs
  • Contracts
  • Service Commands
  • Mad Dog

Does it touch a critical flow like Discovery indexing, Creator Node track upload, Creator Node gateway, or Creator Node file system?

  • 🚨 Yes, this touches creator node selection

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.
Include log analysis if applicable.

  1. Load protocol locally
  2. Load dapp at branch libs-1.0.0
  3. Create an account
  4. Upload a track
  5. Check logs

Screen Shot 2020-11-23 at 6 43 32 PM

Unit Tests:
Please refer to PR.

vicky-g and others added 7 commits November 23, 2020 14:52
* add creator node selection class + unit tests

* update comments + fix code/test

* update test

* pick a cnode based on version, then responsetime

* resolve comments from cn pr

* excuse me vscode y didnt u tell me there was a merge conflict

* change let to const

* remove this.state + refactor filtering services for secondaries

* remove geographic data for now since not using

* update decision tree to sentence case + add back geo location

* update test
libs/src/service-selection/ServiceSelection.js Outdated Show resolved Hide resolved
libs/src/service-selection/constants.js Show resolved Hide resolved
libs/src/utils/network.js Show resolved Hide resolved
Copy link
Contributor

@dmanjunath dmanjunath 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 good!

libs/src/services/creatorNode/CreatorNodeSelection.js Outdated Show resolved Hide resolved
@vicky-g vicky-g merged commit 93ac2ee into master Nov 24, 2020
@vicky-g vicky-g deleted the vg-remerge-cnode-selection branch November 24, 2020 22:16
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.

None yet

3 participants