Distribution algorithm for node selection

Hey @hashbackup,

Your investigation seems to have been fruitful - you have almost all the relevant files already. So I will focus on clarifying a few details:

Firstly, we have different queries for selecting nodes in different circumstances. Many of the functions in the satellite/satellitedb/nodeselection.go file actually have nothing to do with selecting nodes for normal uploads. EDIT: we may have used some of these functions at one point for normal uploads, but it doesn’t look like anything in nodeselection.go is used right now with the current cached node selection for uploads.

Here is the precise path that is followed for a new segment upload (links include the line numbers):

Node selection is something that we have modified and reworked a lot over time, especially as we add new features (e.g. a separate node selection mechanism for repair, graceful exit). Furthermore, we have services like audit, which perform audits on a per-node basis, but select segments to audit without even looking at the nodes table or using the overlay service.

Anyway, I hope I was able to help clarify something, and I’m happy to answer any followup questions, as I may not have fully addressed your comment.

4 Likes