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

Perf optimize mutable state DB operation #1463

Merged
merged 2 commits into from Apr 15, 2021

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Reduce unnecessary update to DB if deletion is specified
    • Activity
    • Timer
    • Cancel External
    • Signal External
    • Child workflow
  • Rename newMutableStateBuilderWithVersionHistories to newMutableStateBuilder
  • Combine previous newMutableStateBuilder and Load to newMutableStateBuilderFromDB

Why?
Remove unnecessary DB operation, e.g. update one activity and within the same transaction delete it.
Close #1399

How did you test it?
Existing tests

Potential risks
N/A

Is hotfix candidate?
No

* Reduce unnecessary update to DB if deletion is specified
  * Activity
  * Timer
  * Cancel External
  * Signal External
  * Child workflow
* Rename newMutableStateBuilderWithVersionHistories to newMutableStateBuilder
* Combine previous newMutableStateBuilder and Load to newMutableStateBuilderFromDB
@wxing1292 wxing1292 requested review from alexshtin and a team April 15, 2021 18:13
@wxing1292 wxing1292 enabled auto-merge (squash) April 15, 2021 18:14
}

// TODO unify Load and StartTransaction
func (e *mutableStateBuilder) Load(
state *persistencespb.WorkflowMutableState,
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth to rename state to mutableState or ms here. Or leave it for the future refactorings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have one PR to be send out in few minutes, i can address it there

@wxing1292 wxing1292 merged commit 682b1f2 into temporalio:master Apr 15, 2021
@wxing1292 wxing1292 deleted the perf-optimize-ms branch April 15, 2021 20:28
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.

Perf optimization when create / update workflow execution
2 participants