Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (m *DispatcherOrchestrator) handleCloseRequest(

log.Info("try close dispatcher manager",
zap.String("changefeed", cfId.String()), zap.Bool("success", response.Success))
return m.sendResponse(from, messaging.MaintainerTopic, response)
return m.sendResponse(from, messaging.MaintainerManagerTopic, response)
}

func createBootstrapResponse(
Expand Down
10 changes: 4 additions & 6 deletions maintainer/maintainer_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ func NewMaintainerManager(
}

mc.RegisterHandler(messaging.MaintainerManagerTopic, m.recvMessages)
mc.RegisterHandler(messaging.MaintainerTopic,
func(ctx context.Context, msg *messaging.TargetMessage) error {
req := msg.Message[0].(*heartbeatpb.MaintainerCloseResponse)
return m.dispatcherMaintainerMessage(ctx, common.NewChangefeedIDFromPB(req.ChangefeedID), msg)
})
return m
}

Expand All @@ -91,13 +86,16 @@ func (m *Manager) recvMessages(ctx context.Context, msg *messaging.TargetMessage
case m.msgCh <- msg:
}
return nil
// receive bootstrap response message from the dispatcher manager
// receive bootstrap response message from the dispatcher manager
case messaging.TypeMaintainerBootstrapResponse:
req := msg.Message[0].(*heartbeatpb.MaintainerBootstrapResponse)
return m.dispatcherMaintainerMessage(ctx, common.NewChangefeedIDFromPB(req.ChangefeedID), msg)
case messaging.TypeMaintainerPostBootstrapResponse:
req := msg.Message[0].(*heartbeatpb.MaintainerPostBootstrapResponse)
return m.dispatcherMaintainerMessage(ctx, common.NewChangefeedIDFromPB(req.ChangefeedID), msg)
case messaging.TypeMaintainerCloseResponse:
req := msg.Message[0].(*heartbeatpb.MaintainerCloseResponse)
return m.dispatcherMaintainerMessage(ctx, common.NewChangefeedIDFromPB(req.ChangefeedID), msg)
// receive heartbeat message from dispatchers
case messaging.TypeHeartBeatRequest:
req := msg.Message[0].(*heartbeatpb.HeartBeatRequest)
Expand Down
2 changes: 1 addition & 1 deletion maintainer/maintainer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (m *mockDispatcherManager) onDispatchRequest(

func (m *mockDispatcherManager) onMaintainerCloseRequest(msg *messaging.TargetMessage) {
_ = m.mc.SendCommand(messaging.NewSingleTargetMessage(msg.From,
messaging.MaintainerTopic, &heartbeatpb.MaintainerCloseResponse{
messaging.MaintainerManagerTopic, &heartbeatpb.MaintainerCloseResponse{
ChangefeedID: msg.Message[0].(*heartbeatpb.MaintainerCloseRequest).ChangefeedID,
Success: true,
}))
Expand Down
Loading