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 history scavenger bug on delete mutable state #3588

Merged
merged 4 commits into from Nov 15, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Nov 14, 2022

What changed?
Fix history scavenger bug on delete mutable state

Why?

  1. Check mutable state running status prior to the deletion.
  2. Add log message for deleted workflow to book deletion record.

How did you test it?
Add new unit tests.

Potential risks
No

Is hotfix candidate?
Yes

@yux0 yux0 requested a review from a team as a code owner November 14, 2022 19:32
@yux0 yux0 requested a review from yiminc November 14, 2022 19:34
@@ -339,6 +340,11 @@ func (s *Scavenger) cleanUpWorkflowPastRetention(
ctx context.Context,
mutableState *persistencepb.WorkflowMutableState,
) error {
if mutableState.GetExecutionState().GetState() != enums.WORKFLOW_EXECUTION_STATE_COMPLETED {
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 need to account for WORKFLOW_EXECUTION_STATE_VOID and WORKFLOW_EXECUTION_STATE_CORRUPTED here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only to clean up past retention data. Currently no plan to clean up corrupted data or in void state.

@yux0 yux0 merged commit e7f99d0 into temporalio:master Nov 15, 2022
@yux0 yux0 deleted the history-scavenger branch November 15, 2022 03:01
alexshtin pushed a commit that referenced this pull request Nov 15, 2022
* Check workflow state in scavenger

* Log deleted workflow as record
alexshtin pushed a commit that referenced this pull request Nov 15, 2022
* Check workflow state in scavenger

* Log deleted workflow as record
alexshtin pushed a commit that referenced this pull request Nov 15, 2022
* Check workflow state in scavenger

* Log deleted workflow as record
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