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

What if a rollback happens? #237

Closed
DavidBadura opened this issue Apr 28, 2022 · 1 comment · Fixed by #239
Closed

What if a rollback happens? #237

DavidBadura opened this issue Apr 28, 2022 · 1 comment · Fixed by #239
Assignees
Labels
Milestone

Comments

@DavidBadura
Copy link
Member

When the state of an aggregate has changed, "uncommitted" events are generated. These events are fetched from the aggregate when saving and the list of uncommitted events is emptied. If an error occurs when saving and a rollback occurs, then the "uncommitted" events are lost. However, the state of the aggregate has remained. If you then change the aggregate again, an "uncommittet" event is generated again, which can then be saved. The problem here is that the event/change was created based on the state, which is now not saved. The events in between are missing. This also means that the state is invalid in the case of a rebuild.

The question now is, what can we improve so that something like this doesn't happen?

@DavidBadura DavidBadura added this to the next milestone Apr 28, 2022
@DavidBadura DavidBadura linked a pull request May 3, 2022 that will close this issue
@DavidBadura DavidBadura self-assigned this May 3, 2022
@DavidBadura
Copy link
Member Author

The repository has been made stateless so that the aggregate can be fetched again. And change the saving of the snapshot to ensure that only snapshots of persistated data/events are created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant