HDDS-15578. Prevent throwing InvalidStateTransitionException from updateContainerStateWithSequenceId#10525
Open
ivandika3 wants to merge 5 commits into
Open
HDDS-15578. Prevent throwing InvalidStateTransitionException from updateContainerStateWithSequenceId#10525ivandika3 wants to merge 5 commits into
ivandika3 wants to merge 5 commits into
Conversation
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.
What changes were proposed in this pull request?
There are methods annotated with
@Replicatethat can throw InvalidStateTransitionException like ContainerStateManager#updateContainerStateWithSequenceId.When the method is applied by SCM Ratis, an exception from the StateMachineUpdater path can terminate SCM although it is not really a critical error (e.g. if there are duplicate events, we can simply ignore one).
Example risk:
The chance is very low since most of there is a check of the container state before in updateContainerStateWithSequenceId the caller will check that the current container state is expected, but it's there. Additionally, the
makeStateTransitionIdempotentalso adds a guard to make sure that transition is idempotent.We can try to fix it by
Or we can simply catch InvalidStateTransitionException SCMStateMachine#applyTransaction, but this means that all future InvalidStateTransitionException are non-fatal.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15578
How was this patch tested?
CI (https://github.com/ivandika3/ozone/actions/runs/27731733234)