-
Notifications
You must be signed in to change notification settings - Fork 2
Add UploadNodes to control uploads more tightly #559
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
Conversation
| }, | ||
| } | ||
|
|
||
| ProdUploadNodes = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need input on what these should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is good for now
raymondjacobson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we tested this w/ local client, etc.?
| }, | ||
| } | ||
|
|
||
| ProdUploadNodes = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is good for now
| contentNodes := make([]contentNode, 0, len(healthyNodes)) | ||
| for _, node := range healthyNodes { | ||
| // icky reaching into config to check upload nodes | ||
| if slices.Contains(app.contentNodeMonitor.config.UploadNodes, node.Endpoint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just read Config directly here? Not sure why we need to grab it from the monitor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym? Like config.Cfg? I would like to avoid globals but maybe you're right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I meant config.Cfg. Harder to test for sure.
Alternatively, I have often wondered why we don't make the config available on the app instance itself....
Creates a configurable list of nodes that will be used for uploads (as they are returned by health_check)
Keeps existing health monitoring for all nodes, just filters at the end. A "smarter" method might be filtering before tracking health, but this gets the job done for now. Opted to do the filtering outside of the monitor as it might be confusing why it only has a small number of nodes it thinks are "healthy".
Notably still might be a footgun, as it's not obvious that health check would be limited to the UploadNodes