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

Add ra_machine:snapshot_installed/4 callback to pass old state #467

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

the-mikedavis
Copy link
Member

@the-mikedavis the-mikedavis commented Aug 23, 2024

This adds an extended version of the existing Machine:snapshot_installed(SnapMeta, NewState) callback which adds parameters for the old state: the state of the machine before the snapshot was installed and also its version since the snapshot installation might cause a version bump.

Module:snapshot_installed(SnapMeta, OldMacVer, OldState, NewState)

This is meant for any machine that needs to diff the old and new states. For example Khepri needs this (see rabbitmq/khepri#290) to update its projections when either the projections change or any part of the tree which is covered by a projection's pattern.

@the-mikedavis the-mikedavis force-pushed the md/snapshot-installed-old-state branch from 3e2f52e to 0290e03 Compare August 26, 2024 17:13
@the-mikedavis the-mikedavis marked this pull request as ready for review August 26, 2024 17:13
@michaelklishin michaelklishin merged commit b5f6b38 into main Aug 27, 2024
9 checks passed
@michaelklishin michaelklishin deleted the md/snapshot-installed-old-state branch August 27, 2024 18:34
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.

3 participants