Skip to content

Commit

Permalink
fix maintainer_controller.go panic issue (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdojjy authored Oct 21, 2024
1 parent 3b89639 commit 0a1aafb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions maintainer/maintainer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,18 @@ func (c *Controller) HandleStatus(from node.ID, statusList []*heartbeatpb.TableS
dispatcherID := common.NewDispatcherIDFromPB(status.ID)
c.operatorController.UpdateOperatorStatus(dispatcherID, from, status)
stm := c.GetTask(dispatcherID)
// it's normal case when the span is not found in replication db
// the span is removed from replication db first, so here we only check if the span status is working or not
if stm == nil && status.ComponentStatus == heartbeatpb.ComponentState_Working {
log.Warn("no span found, remove it",
zap.String("changefeed", c.changefeedID),
zap.String("from", from.String()),
zap.Any("status", status),
zap.String("span", dispatcherID.String()))
// if the span is not found, and the status is working, we need to remove it from dispatcher
_ = c.messageCenter.SendCommand(replica.NewRemoveInferiorMessage(from, c.changefeedID, status.ID))
if stm == nil {
// it's normal case when the span is not found in replication db
// the span is removed from replication db first, so here we only check if the span status is working or not
if status.ComponentStatus == heartbeatpb.ComponentState_Working {
log.Warn("no span found, remove it",
zap.String("changefeed", c.changefeedID),
zap.String("from", from.String()),
zap.Any("status", status),
zap.String("span", dispatcherID.String()))
// if the span is not found, and the status is working, we need to remove it from dispatcher
_ = c.messageCenter.SendCommand(replica.NewRemoveInferiorMessage(from, c.changefeedID, status.ID))
}
continue
}
nodeID := stm.GetNodeID()
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

// Version information.
var (
ReleaseVersion = "None"
ReleaseVersion = "v8.3.0"
BuildTS = "None"
GitHash = "None"
GitBranch = "None"
Expand Down

0 comments on commit 0a1aafb

Please sign in to comment.