Skip to content

Commit cb8db1f

Browse files
author
Yves Trudeau
committed
Modified the rendering of the errors, nothing added if not additional errors.
1 parent 4664a76 commit cb8db1f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

go/inst/instance_topology.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,7 +2814,7 @@ func relocateReplicasInternal(replicas [](*Instance), instance, other *Instance)
28142814
return RepointTo(replicas, &other.Key)
28152815
}
28162816
// GTID
2817-
gtidErrorsMsg := ""
2817+
gtidErrorsMsg := "Additional Errors: "
28182818
{
28192819
movedReplicas, unmovedReplicas, err, errs := moveReplicasViaGTID(replicas, other, nil)
28202820

@@ -2860,7 +2860,11 @@ func relocateReplicasInternal(replicas [](*Instance), instance, other *Instance)
28602860
}
28612861

28622862
// Too complex
2863-
return nil, log.Errorf("Relocating %+v replicas of %+v below %+v turns to be too complex; please do it manually. Additional Errors: %v", len(replicas), instance.Key, other.Key,gtidErrorsMsg), errs
2863+
// if the len of gtidErrorsMsg is less than 21, no errors were added
2864+
if len(gtidErrorsMsg) < 21 {
2865+
gtidErrorsMsg = ""
2866+
}
2867+
return nil, log.Errorf("Relocating %+v replicas of %+v below %+v turns to be too complex; please do it manually. %v", len(replicas), instance.Key, other.Key, gtidErrorsMsg), errs
28642868
}
28652869

28662870
// RelocateReplicas will attempt moving replicas of an instance indicated by instanceKey below another instance.

0 commit comments

Comments
 (0)