Re-initialise aux state when recovering from a recovery checkpoint - #645
Merged
Conversation
aux_state is transient and is only ever set once, by ra_server:init/2, before recovery checkpoint recovery runs. Since a recovery checkpoint can skip log replay across machine version upgrades, the previously initialised aux state could be silently carried over and handed to a handle_aux/5 it was never created for.
There was a problem hiding this comment.
Pull request overview
This PR fixes a recovery-edge-case where aux_state (a transient, non-snapshotted value) could be silently carried across a recovery-checkpoint jump to a different effective machine module/version, potentially passing incompatible aux state into the machine’s aux handling.
Changes:
- Re-initialise
aux_statewhen recovering from a recovery checkpoint (even if the checkpoint’s machine version matches the current effective version). - Add new CT coverage ensuring
aux_stateis re-initialised both across machine-version changes and in same-version recovery-checkpoint recovery.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/ra_server.erl |
Re-initialises aux_state during recovery-checkpoint recovery based on the effective machine module. |
test/ra_server_SUITE.erl |
Adds tests asserting aux_state is re-initialised when using recovery checkpoints (upgrade + same-version cases). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kjnilsson
marked this pull request as ready for review
July 22, 2026 07:52
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aux_state is transient and is only ever set once, by ra_server:init/2, before recovery checkpoint recovery runs. Since a recovery checkpoint can skip log replay across machine version upgrades, the previously initialised aux state could be silently carried over and handed to a handle_aux/5 it was never created for.