Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
satellite/nodeselection: differentiate between excluded and alreadySe…
…lected nodes Before this patch, the NodeSelector interface was this: ``` type NodeSelector func(n int, alreadySelected []storj.NodeID) ([]*SelectedNode, error) ``` The problem is that we don't differentiate between alreadySelected and excluded nodes. 1. from excluded nodes, we only need the ID. These should always be excluded (for example, because a retry) 2. alreadySelected nodes are different, we need the full node information to make better decision A good example for the better decision is the updated `BalancedGroupBasedSelector`. Let's say we have nodes from three groups: * 1 nodes from group A * 10 nodes from group B * 10 nodes from group C If we need 9 nodes, based on the current logic, we try to select 3 nodes, from each groups. It's not possible with group A, therefore the selection will be sg like to A=1, B=4, C=5. But what happens if we already have 4 B nodes, and we need to select 5. The current logic will try to select 5 equally from A and B and C. But that's not what we need: our goal is having an equal balance after the selection (which means that we need A + C nodes instead) Change-Id: If4c1deab08ea69f86bc8f3a7f2a4324ba99d6137
- Loading branch information
Showing
14 changed files
with
142 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.