Fix snapshot installation CRC failure - #369
Merged
Merged
Conversation
Due to the unwise use of term_to_binary rather than using the original binary data in the replication of snapshot states. This change: Introduces a new optional ra_snapshot callback: context/0 This is called by the sending Ra leader node to discover context and capabilities of the receiver. In this case it is used to indicate if the receiver is capabable of receiving the entire snapshot file. Receiving the entire file is the updated approach that ensures the CRC check will be done on the same binary data it was generated from. If the receiver does not have the context/0 callback or does not indicate support the old approach of sending the deserialised metat data map and any data following that is used. When a snapshot is received from an old node (i.e. _not_ including the entire file) the receiver will not validate the checksum (as it may fail due to differences in map serialisation) and instead patch up it's local file with it's own calculcated checksum. The scenario where a snapshot taken by a newer version of OTP and is then sent to a member using the old code cannot be handled and the old node will fail at snapshot checksum validation.
Before tryign to send a snapshot we check if the target node is connected and if not update the peer's status to the new "disconnected" state. This state is reverted to "normal" on all nodeup events.
michaelklishin
approved these changes
May 10, 2023
michaelklishin
approved these changes
May 10, 2023
Contributor
|
rabbitmq/rabbitmq-server#8143 makes rolling upgrades to Erlang 26 succeed under a constant load involving QQs. |
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.
Due to the unwise use of term_to_binary rather than using the original binary data in the replication of snapshot states.
This change:
Introduces a new optional ra_snapshot callback: context/0
This is called by the sending Ra leader node to discover context and capabilities of the receiver. In this case it is used to indicate if the receiver is capabable of receiving the entire snapshot file.
Receiving the entire file is the updated approach that ensures the CRC check will be done on the same binary data it was generated from.
If the receiver does not have the context/0 callback or does not indicate support the old approach of sending the deserialised metat data map and any data following that is used.
When a snapshot is received from an old node (i.e. not including the entire file) the receiver will not validate the checksum (as it may fail due to differences in map serialisation) and instead patch up it's local file with it's own calculcated checksum.
The scenario where a snapshot taken by a newer version of OTP and is then sent to a member using the old code cannot be handled and the old node will fail at snapshot checksum validation.
Fixes #368