Skip to content

Commit ef90427

Browse files
wk989898lidezhu
authored andcommitted
maintainer: add more info when adding operator failed (#4098)
1 parent 4aa32dc commit ef90427

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

maintainer/operator/operator_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@ func (oc *Controller) RemoveTasksByTableIDs(tables ...int64) {
143143
// AddOperator adds an operator to the controller, if the operator already exists, return false.
144144
func (oc *Controller) AddOperator(op operator.Operator[common.DispatcherID, *heartbeatpb.TableSpanStatus]) bool {
145145
oc.mu.RLock()
146-
if _, ok := oc.operators[op.ID()]; ok {
146+
if old, ok := oc.operators[op.ID()]; ok {
147147
oc.mu.RUnlock()
148148
log.Info("add operator failed, operator already exists",
149149
zap.String("role", oc.role),
150150
zap.Stringer("changefeedID", oc.changefeedID),
151-
zap.String("operator", op.String()))
151+
zap.String("operator", op.String()),
152+
zap.String("oldOperator", old.OP.String()))
152153
return false
153154
}
154155
oc.mu.RUnlock()

0 commit comments

Comments
 (0)