Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support to ignore error when delete a task #167

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
3 changes: 3 additions & 0 deletions core/reader/replicate_channel_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ func (r *replicateChannelManager) AddPartition(ctx context.Context, dbInfo *mode
func (r *replicateChannelManager) StopReadCollection(ctx context.Context, info *pb.CollectionInfo) error {
for _, channel := range info.GetPhysicalChannelNames() {
handler := r.stopReadChannel(channel, info.ID)
if handler == nil {
continue
}
handler.Close()
}
r.collectionLock.Lock()
Expand Down
3 changes: 3 additions & 0 deletions server/cdc_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,9 @@ func (e *MetaCDC) Delete(req *request.DeleteRequest) (*request.DeleteResponse, e
_, ok := e.cdcTasks.data[req.TaskID]
e.cdcTasks.RUnlock()
if !ok {
if req.IgnoreNotFound {
return &request.DeleteResponse{}, nil
}
return nil, servererror.NewClientError("not found the task, task_id: " + req.TaskID)
}

Expand Down
3 changes: 2 additions & 1 deletion server/model/request/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ package request

//go:generate easytags $GOFILE json,mapstructure
type DeleteRequest struct {
TaskID string `json:"task_id" mapstructure:"task_id"`
TaskID string `json:"task_id" mapstructure:"task_id"`
IgnoreNotFound bool `json:"ignore_not_found" mapstructure:"ignore_not_found"`
}

type DeleteResponse struct{}
Loading