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 sanitize mutable state after replication #3479

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Oct 12, 2022

What changed?
Fix sanitize mutable state after replication

Why?

  1. The LastFirstTxnID should use the one from append history node. Otherwise, it will break getReverseHistory.
  2. Sanitize closeTaskID and closeVisibilityTaskID in CreateAsClose case.

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 12, 2022 06:42
@@ -849,7 +850,7 @@ func (r *HistoryReplicatorImpl) backfillHistory(
}
case *serviceerror.NotFound:
default:
return nil, err
return nil, common.EmptyVersion, err
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 the value is a "TxnID/TaskID"? Returning a "Version" looks quite confusing to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update to use a EmptyTaskID

mutableState.executionInfo.LastFirstEventTxnId = common.EmptyVersion
mutableState.executionInfo.LastFirstEventTxnId = lastFirstEventTxnID
mutableState.executionInfo.CloseVisibilityTaskId = common.EmptyVersion
mutableState.executionInfo.CloseTransferTaskId = common.EmptyVersion
Copy link
Member

Choose a reason for hiding this comment

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

Shall we sanitize LastEventTaskId field as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. This field is to calculate the vector clock. It should not be changed.

Comment on lines +55 to +56
// EmptyTaskID is the id of the empty task
EmptyTaskID int64 = 0
Copy link
Member

Choose a reason for hiding this comment

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

nit: is this a dup of EmptyEventTaskID defined above?

@yux0 yux0 merged commit ef21405 into temporalio:master Oct 13, 2022
@yux0 yux0 deleted the migration-history branch October 13, 2022 20:21
dnr pushed a commit that referenced this pull request Oct 17, 2022
* Fix sanitize mutable state after replication
dnr pushed a commit that referenced this pull request Oct 18, 2022
* Fix sanitize mutable state after replication
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