-
Notifications
You must be signed in to change notification settings - Fork 805
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
Add ttl for sticky task list #510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please double check that old client that does not set the kind field should still works
return &LeaseTaskListResponse{TaskListInfo: tli}, nil | ||
} | ||
|
||
// From TaskManager interface | ||
func (d *cassandraPersistence) UpdateTaskList(request *UpdateTaskListRequest) (*UpdateTaskListResponse, error) { | ||
tli := request.TaskListInfo | ||
|
||
if tli.Kind == TaskListKindWorker { // if task_list is sticky, then update with TTL | ||
fmt.Println("vancexu in updateTaskList with TTL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Thanks for catching this.
common/persistence/dataInterfaces.go
Outdated
// Kinds of task lists | ||
const ( | ||
TaskListKindNormal = iota | ||
TaskListKindWorker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to Sticky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -196,6 +196,11 @@ enum HistoryEventFilterType { | |||
CLOSE_EVENT, | |||
} | |||
|
|||
enum TaskListKind { | |||
NORMAL, | |||
WORKER, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename WORKER to STICKY
schema/cadence/schema.cql
Outdated
@@ -132,6 +132,7 @@ CREATE TYPE task_list ( | |||
name text, | |||
type int, -- enum TaskRowType {ActivityTask, DecisionTask} | |||
ack_level bigint, -- task_id of the last acknowledged message | |||
kind int, -- enum TaskListKind {Normal, Worker} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comments after rename WORKER to STICKY
Manually test old client works, but in that case the tasklist will be treated as NORMAL all the time and wouldn't be removed automatically. |
This will delete sticky task list in one day after no ack update happens for that task list.
Relate issue: #472