Skip to content

Commit 04ccf4b

Browse files
committed
mmaprototype: populate conf.NumVoters to conf.NumReplicas if 0
Previously, MMA used the given span config directly. However, the comment on config.NumVoters specifies that if it is set to zero, the voter replica count should default to NumReplicas, which is usually handled by SpanConfig.GetNumVoters().
1 parent 4b40f6b commit 04ccf4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/kv/kvserver/allocator/mmaprototype/constraint.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ type internedLeasePreference struct {
252252
func makeNormalizedSpanConfig(
253253
conf *roachpb.SpanConfig, interner *stringInterner,
254254
) (*normalizedSpanConfig, error) {
255+
if conf.NumVoters == 0 {
256+
conf.NumVoters = conf.NumReplicas
257+
}
255258
var normalizedConstraints, normalizedVoterConstraints []internedConstraintsConjunction
256259
var err error
257260
if conf.VoterConstraints != nil {

0 commit comments

Comments
 (0)