-
Notifications
You must be signed in to change notification settings - Fork 813
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
Conversation
wxing1292
commented
Jun 12, 2019
- 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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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