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

Add execution scavenger for retention #3457

Merged
merged 9 commits into from
Oct 14, 2022
Merged

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Oct 6, 2022

What changed?
Add execution scavenger for retention

Why?
Scan execution table to find workflow data that pass the TTL.

How did you test it?
Local test

Potential risks

Is hotfix candidate?

@yux0 yux0 requested a review from a team as a code owner October 6, 2022 22:02
)

type (
// mutableStateIDValidator is a validator that does shallow checks that
// * ID >= common.FirstEventID
// * ID <= last event ID
mutableStateIDValidator struct{}
mutableStateIDValidator struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove ID from the name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all ID in the names.

service/worker/scanner/executions/task.go Show resolved Hide resolved
return nil, err
}
retention := ns.Retention()
if ttl > 0 && ttl > retention {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add some buffer here in case deletion time is not created/executed due to some other tasks pending (like archival task)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Add a buffer config

service/worker/scanner/scanner.go Outdated Show resolved Hide resolved
@yux0 yux0 merged commit a0ea177 into temporalio:master Oct 14, 2022
@yux0 yux0 deleted the retention-scavenger branch October 14, 2022 00:15
dnr pushed a commit that referenced this pull request Oct 17, 2022
* Add execution scavenger for retention
dnr pushed a commit that referenced this pull request Oct 18, 2022
* Add execution scavenger for retention
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.

None yet

2 participants