HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case of failure#4525
Merged
duongkame merged 6 commits intoapache:masterfrom Apr 13, 2023
Merged
HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case of failure#4525duongkame merged 6 commits intoapache:masterfrom
duongkame merged 6 commits intoapache:masterfrom
Conversation
neils-dev
reviewed
Apr 4, 2023
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java
Outdated
Show resolved
Hide resolved
Contributor
|
Thanks @hemantk-12 for the update. |
devmadhuu
reviewed
Apr 5, 2023
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java
Outdated
Show resolved
Hide resolved
prashantpogde
approved these changes
Apr 11, 2023
Contributor
prashantpogde
left a comment
There was a problem hiding this comment.
Thank you @hemantk-12 for making these changes. LGTM.
duongkame
reviewed
Apr 12, 2023
...nager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotCreateRequest.java
Outdated
Show resolved
Hide resolved
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?
This change is to remove snapshot from the
SnapshotChainManagerin case of any failure.It is possible thatcreateSnapshotrequest fails after snapshot gets added to snapshot chain manager because couldn't add it to cache/DB. In this scenario,SnapshotChainManager#globalSnapshotIdwill point to failedcreateSnapshotrequest's snapshotId but in actual it doesn't exist in theSnapshotInfotable. If it doesn't get removed, OM restart will crash onSnapshotChainManager#loadFromSnapshotInfoTablebecause it could not find the previous snapshot which doesn't exist because it was never added to theSnapshotInfotable.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8345
How was this patch tested?
It was tested manually by injecting fault before line and restart the OM node. Verified that OM restarts successfully after the change.