Skip to content

Conversation

@rickyrombo
Copy link
Contributor

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

},
}

ProdUploadNodes = []string{
Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Member

@raymondjacobson raymondjacobson left a 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{
Copy link
Member

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) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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....

@rickyrombo rickyrombo merged commit 4c09d1c into main Nov 19, 2025
5 checks passed
@rickyrombo rickyrombo deleted the mjp-upload-nodes branch November 19, 2025 20:46
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.

4 participants