Skip to content

HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case of failure#4525

Merged
duongkame merged 6 commits intoapache:masterfrom
hemantk-12:HDDS-8345
Apr 13, 2023
Merged

HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case of failure#4525
duongkame merged 6 commits intoapache:masterfrom
hemantk-12:HDDS-8345

Conversation

@hemantk-12
Copy link
Contributor

What changes were proposed in this pull request?

This change is to remove snapshot from the SnapshotChainManager in case of any failure.It is possible that createSnapshot request fails after snapshot gets added to snapshot chain manager because couldn't add it to cache/DB. In this scenario, SnapshotChainManager#globalSnapshotId will point to failed createSnapshot request's snapshotId but in actual it doesn't exist in the SnapshotInfo table. If it doesn't get removed, OM restart will crash on SnapshotChainManager#loadFromSnapshotInfoTable because it could not find the previous snapshot which doesn't exist because it was never added to the SnapshotInfo table.

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.

@neils-dev neils-dev self-requested a review April 4, 2023 00:53
@adoroszlai adoroszlai added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Apr 4, 2023
@adoroszlai adoroszlai changed the title HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case couldn't add it to the cache/DB or any other failure. HDDS-8345. [Snapshot] Remove snapshot from SnapshotChainManager in case of failure Apr 4, 2023
@neils-dev
Copy link
Contributor

Thanks @hemantk-12 for the update.
+1

Copy link
Contributor

@prashantpogde prashantpogde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @hemantk-12 for making these changes. LGTM.

Copy link
Contributor

@duongkame duongkame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, +1.

@duongkame duongkame merged commit 8515c13 into apache:master Apr 13, 2023
@hemantk-12 hemantk-12 deleted the HDDS-8345 branch October 28, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants