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

Refactor reset mutable state API #2012

Merged
merged 2 commits into from
Jun 12, 2019
Merged

Conversation

wxing1292
Copy link
Contributor

  • Supporting insertion of transfer / timer / replication task.
  • Add more check on last write version and workflow state

* Supporting insertion of transfer / timer / replication task.
* Add more check on last write version and workflow state
if bytes.Equal(currentRow.RunID, runID) {
return &p.ConditionFailedError{Msg: fmt.Sprintf(
"Assertion on current record failed failed. Current run ID was %v, expected %v",
currentRow.RunID,
Copy link
Contributor

Choose a reason for hiding this comment

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

this log is misleading - expected and got will always be same - I think you want to return error saying that the records are expected to be different but they are same

@@ -368,19 +368,28 @@ type (

// InternalResetMutableStateRequest is used to reset workflow execution state for Persistence Interface
InternalResetMutableStateRequest struct {
PrevRunID string
// previous workflow information
PrevRunID string
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to create a separate persistence type for a "WorkflowRun" - that contains (runID, lastWriteVersion, state) ? Looks like these params are needed / passed everywhere for assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

created an issue for this: #2013

@@ -1880,23 +1885,92 @@ func createTimerTasks(
return nil
}

func assertAndUpdateCurrentExecution(tx sqldb.Tx, shardID int, domainID sqldb.UUID, workflowID string, newRunID sqldb.UUID, previousRunID sqldb.UUID,
func assertNotCurrentExecution(tx sqldb.Tx, shardID int, domainID sqldb.UUID, workflowID string, runID sqldb.UUID) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this being used anywhere, do you need 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.

this is from the 3+DC branch, probably leaked by rebase
i will remove this

@wxing1292 wxing1292 merged commit b4c418b into master Jun 12, 2019
@wxing1292 wxing1292 deleted the refactor-reset-mutable-state branch June 12, 2019 21:52
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.

2 participants