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

Fix admin remove task command for timer queue #3157

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

yycptt
Copy link
Contributor

@yycptt yycptt commented Apr 1, 2020

What changed?

  • Remove DeleteTask method from persistence interface
  • Remove related metrics
  • Use CompleteTask method of executionManger to delete task
  • Add visibility timestamp tag when initializing logger for task
  • Add visibility timestamp flag to admin remove task command

Why?

  • Address Fix admin remove task command for timer queue #3152 and admin tools for deleting tasks need implement mysql one in the future #2479
  • Current admin remove task command doesn't work for timer task as it doesn't accept the value for task visibility timestamp.
  • We have a 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 like CompleteTimerTask, CompleteTransferTask and CompleteReplicationTask in the executionManager interface which does the exactly the same thing (delete the task from DB). By removing DeleteTask from the executionManager, and use CompleteTask method instead, we don't need to implement DeleteTask multiple times. We only need one implementation for the handler of the DeleteTask API call.
  • Another reason for removing DeleteTask method is that I feel this method doesn't belong to the persistence level. The input for this method contains a field called taskType, 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

* Remove DeleteTask method from persistence interface
* Remove related metrics
* Use CompleteTask method of executionManger to delete task
* Add visibility timestamp tag when initializing logger for task
* Add visibility timestamp flag to admin remove task command
@yycptt yycptt requested review from yux0 and a team April 1, 2020 00:34
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 69.124% when pulling 92af943 on yycptt:fix-delete-task into 9b02fec on uber:master.

@yycptt yycptt merged commit 0976e69 into uber:master Apr 1, 2020
@yycptt yycptt deleted the fix-delete-task branch April 1, 2020 05:25
anish531213 pushed a commit that referenced this pull request Apr 10, 2020
* Remove DeleteTask method from persistence interface
* Remove related metrics
* Use CompleteTask method of executionManger to delete task
* Add visibility timestamp tag when initializing logger for task
* Add visibility timestamp flag to admin remove task command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants