server/schedule/placement/fit: pick out the candidates for a rule should be faster when cache the match result for peers to rules #5276
Labels
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement Task
The function
fitRule(idx)
are try to find the best fit recursively, and the following part is to pick out the candidates for the current rule, which may repeatedly call the funcMatchLabelConstraints
when there are lots of rules. so, how about cache the result that if the peer(store, since 1 store can only have 1 peer, so we could use the peer directly) can match the rulepd/server/schedule/placement/fit.go
Lines 214 to 225 in c8775b6
The text was updated successfully, but these errors were encountered: