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 SetWorkflowExecution persistence API #2523

Merged
merged 1 commit into from Feb 19, 2022

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Add SetWorkflowExecution persistence API for allow overwriting a mutable state
  • Update tests

Why?
More functionality

How did you test it?
New tests

Potential risks
N/A

Is hotfix candidate?
No

* Add SetWorkflowExecution persistence API for allow overwriting a mutable state
* Update tests
Comment on lines +996 to +997
// dbVersion is for CAS, so the db record version will be set to `resetWorkflow.DBRecordVersion`
// while CAS on `resetWorkflow.DBRecordVersion - 1`
Copy link
Member

Choose a reason for hiding this comment

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

update comment to not use resetWorkflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

batch := d.Session.NewBatch(gocql.LoggedBatch)

shardID := request.ShardID
workflow := request.SetWorkflowSnapshot
Copy link
Member

Choose a reason for hiding this comment

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

nit: i would use snapshot as this local variable 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.

the GitHub phone app collapse the review comments so did not notice this after merging the PR, will address the comments in the next PR

@@ -75,7 +75,7 @@ func applyWorkflowMutationTx(
workflowMutation.DBRecordVersion,
); err != nil {
switch err.(type) {
case *p.WorkflowConditionFailedError:
case *p.WorkflowConditionFailedError, *p.ConditionFailedError:
Copy link
Member

Choose a reason for hiding this comment

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

wait, did we missed this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a big issue, only the returned error type is not expected.

@wxing1292 wxing1292 merged commit 73f40bf into temporalio:master Feb 19, 2022
@wxing1292 wxing1292 deleted the admin-set branch February 19, 2022 02:17
request.RangeID,
)

conflictRecord := make(map[string]interface{})
Copy link
Member

Choose a reason for hiding this comment

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

nit: conflictRecords?

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 actually one row, the iter can return other rows if multiple rows are involved

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

3 participants