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

Remove namespace max retention #3148

Merged
merged 12 commits into from
Aug 4, 2022
Merged

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jul 27, 2022

What changed?

  1. Remove namespace max retention
  2. Update Archival sequence: 1) archival history 2) call delete workflow API to delete workflow data.

Why?
Support retention > 30 days.

How did you test it?

Potential risks

Is hotfix candidate?

@yux0 yux0 requested review from yycptt and yiminc July 27, 2022 03:00
service/worker/scanner/history/scavenger.go Outdated Show resolved Hide resolved
service/worker/archiver/activities.go Outdated Show resolved Hide resolved
service/history/workflow/delete_manager.go Show resolved Hide resolved
@yux0
Copy link
Contributor Author

yux0 commented Jul 28, 2022

Pending on #3159

@yux0 yux0 marked this pull request as ready for review August 4, 2022 05:44
@yux0 yux0 requested a review from a team as a code owner August 4, 2022 05:44
// This scanner will face racing condition with archiver because it relys on describe mutable state returning entityNotExist error.
// That's why we need to keep MaxWorkflowRetentionPeriod stable and not decreasing all the time.
cleanUpThreshold = common.MaxWorkflowRetentionPeriod * 2
cleanUpThreshold = 60 * 24 * time.Hour
Copy link
Member

Choose a reason for hiding this comment

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

I think we should use a larger duration. The reason is, for each history branch, the scavenger will check if they are older than this threshold, if so it will load mutable state, otherwise it will skip. For majority case, this will be a no-op, so loading mutable state is quite costly if we have to load every single mutable state. Make the duration longer will reduce the chance because by the time when it is over the threshold duration, most of history will already be deleted. This also depends on the duration of the life time of a workflow. So I think we may even need to consider make this configurable via dynamic config. The cost of keeping small percent of garbage history is probably less than the cost of scanning the whole history and mutable states.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it worth to make it configurable and give an arbitrary number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to be configurable and default set to 90 days.

@yux0 yux0 merged commit cae7cba into temporalio:master Aug 4, 2022
@yux0 yux0 deleted the rm-max-rentetion branch August 4, 2022 23:19
yycptt pushed a commit that referenced this pull request Aug 12, 2022
* Remove namespace max 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