Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanschalm authored Sep 4, 2024
1 parent 2045e70 commit 231c2f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/util/cmd/common/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func ConstructClusterAssignment(log zerolog.Logger, partnerNodes, internalNodes
// The following is a heuristic that distributes collectors round-robbin across the specified number of clusters.
// This heuristic only works when all collectors have equal weight! The following sanity check enforces this:
if len(partnerCollectors) > 0 && len(partnerCollectors) > 2*len(internalCollectors) {
return nil, nil, fmt.Errorf("requiring at least x>0 number of partner collection nodes and y > 2x number of internal collection nodes, but got x,y=%d,%d", len(partnerNodes), len(internalNodes))
return nil, nil, fmt.Errorf("requiring at least x>0 number of partner collection nodes and y > 2x number of internal collection nodes, but got x,y=%d,%d", len(partnerCollectors), len(internalCollectors))
}
// sanity check ^ enforces that there is at least one internal node, hence `internalNodes[0].InitialWeight` is always a valid reference weight
refWeight := internalNodes[0].InitialWeight
refWeight := internalCollectors[0].InitialWeight

identifierLists := make([]flow.IdentifierList, numCollectionClusters)
// array to track the 2/3 internal-nodes constraint (internal_nodes > 2 * partner_nodes)
Expand Down

0 comments on commit 231c2f4

Please sign in to comment.