Fix admin remove task command for timer queue #3157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Why?
DeleteTask
method in the executionManager interface, which is only implemented for cassandra not sql. The purpose of this method is to delete tasks that got stuck. However we already have methods likeCompleteTimerTask
,CompleteTransferTask
andCompleteReplicationTask
in the executionManager interface which does the exactly the same thing (delete the task from DB). By removingDeleteTask
from the executionManager, and useCompleteTask
method instead, we don't need to implementDeleteTask
multiple times. We only need one implementation for the handler of theDeleteTask
API call.DeleteTask
method is that I feel this method doesn't belong to the persistence level. The input for this method contains a field calledtaskType
, which is basically the row type for cassandra. However for other persistence implementation, like sql, there's no such concept. Enforce a task type for those implementations also doesn't sound right to me. After removing the method from persistence layer, we can define the task type at application layer, which makes more sense to me.How did you test it?
Tested locally. Successfully deleted transfer/timer/replication task in cassandra while not affecting other tasks.
Potential risks
N/A