-
Notifications
You must be signed in to change notification settings - Fork 1k
Add RebuildMutableState API #2532
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
Conversation
if err != nil { | ||
return nil, adh.error(err, scope) | ||
} |
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.
👍
// note: this is an admin API, for operator to recover a corrupted mutable state, so state transition count | ||
// should remain the same, the -= 1 exists here since later CloseTransactionAsSnapshot will += 1 to state transition count | ||
rebuildMutableState.GetExecutionInfo().StateTransitionCount = stateTransitionCount - 1 | ||
rebuildMutableState.SetUpdateCondition(rebuildMutableState.GetNextEventID(), dbRecordVersion) |
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.
If next eventID in db is corrupted, does it mean the update will fail?
Shall we use the nextEvenID in msRecord
here?
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.
we stop using next event ID as CAS condition ~6 months ago, we should do more cleanup.
What changed?
Why?
This API allows operator to rebuild the mutable state using persisted history events, in case DB corruption ever occurs.
How did you test it?
Integration test
Potential risks
N/A
Is hotfix candidate?
No