Why does comparing RuleFit involve len(Peers)

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 比较RuleFit为什么涉及len(Peers)

| username: TiDBer_OWY959zY

See pd/pkg/schedule/placement/fit.go

func compareRuleFit(a, b *RuleFit) int {
	switch {
	case len(a.Peers) < len(b.Peers):
		return -1
	case len(a.Peers) > len(b.Peers):
		return 1
	case len(a.PeersWithDifferentRole) > len(b.PeersWithDifferentRole):
		return -1
	case len(a.PeersWithDifferentRole) < len(b.PeersWithDifferentRole):
		return 1
	case a.IsolationScore < b.IsolationScore:
		return -1
	case a.IsolationScore > b.IsolationScore:
		return 1
	case a.WitnessScore > b.WitnessScore:
		return -1
	case a.WitnessScore < b.WitnessScore:
		return 1
	default:
		return 0
	}
}

The larger the IsolationScore, the better the RuleFit, which makes sense.
However, why is the RuleFit with a larger len(Peers) considered better?
After all, under what circumstances would the two RuleFits here have different len(Peers)?

| username: Kongdom | Original post link

:thinking: IsolationScore should be a score, right? The higher the score, the higher the match, which should be normal.

Did the original poster have this question after reading this article?

| username: ShawnYan | Original post link

Corresponding source code:

and PR:

| username: dba远航 | Original post link

Learned.

| username: TiDBer_OWY959zY | Original post link

Hello, my question is about len(Peers)

case len(a.Peers) > len(b.Peers):
  return 1
| username: Kongdom | Original post link

:thinking: This should be comparing the size of the replicas.