-
Notifications
You must be signed in to change notification settings - Fork 874
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
Replace Cassandra visibility TTL with explicit DELETE #2387
Replace Cassandra visibility TTL with explicit DELETE #2387
Conversation
// Primary key in closed_execution table has close_time which is not in the request. | ||
// Query closed_execution table first (using secondary index by workflow_id) to get close_time. | ||
// This is not very efficient if workflow has multiple executions. |
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.
I don't like this part, this is one extra read for every visibility delete. Did you try to put close_time into task?
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.
Changed. And I like new approach better than before.
query := v.session. | ||
Query(templateGetClosedWorkflowExecutionsByID, | ||
request.NamespaceID.String(), | ||
namespacePartition, | ||
persistence.UnixMilliseconds(minTime), | ||
persistence.UnixMilliseconds(maxTime), | ||
request.WorkflowID). | ||
Consistency(v.lowConslevel) | ||
iter := query.Iter() | ||
|
||
wfExecution, has := readClosedWorkflowExecutionRecord(iter) |
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.
Does this query handles pagination as well? If workflowID is a cron, you could have many RunIDs.
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.
Not relevant anymore, but it turned out that default page size is 5000 (not unlimited, as I would expect it to be if not specified).
dd9318c
to
e35f5eb
Compare
e35f5eb
to
26aeb85
Compare
What changed?
Replace Cassandra visibility TTL with explicit
DELETE
.Why?
Previously visibility records were deleted only when retention kicked in. For new
DeleteWorklfowExecution
API it is required to be able to delete visibility record in any given moment of time.How did you test it?
Modify existing unit test. Will add integration tests for
DeleteWorkflowExecution
API in corresponding PR.Potential risks
If Cassandra based visibility is used and workflow has many executions, new implementation is slower. No production environments should use Cassandra based visibility though.No risks.
Is hotfix candidate?
No.