Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10250. Use SnapshotId as key in SnapshotCache #6139

Merged
merged 3 commits into from
Feb 10, 2024

Conversation

hemantk-12
Copy link
Contributor

What changes were proposed in this pull request?

Currently, SnapshotName (/volumeName/bucketName/snapshotName) is used as key in SnapshotCache which makes it hard for operations like Snapshot rename. Discussions: #6006 (review)

This change is to use SnapshotId as key in SnapshotCache rather than SnapshotName because SnapshotId is unique and is never changed throughout the snapshot's lifecycle.

What is the link to the Apache JIRA

HDDS-10250

How was this patch tested?

Updated existing unit tests to work with SnapshotId. No new tests were added.

@hemantk-12 hemantk-12 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Jan 31, 2024
@hemantk-12 hemantk-12 requested a review from smengcl January 31, 2024 21:19
@hemantk-12 hemantk-12 changed the title HDDS-10250 Use SnapshotId as key in SnapshotCache HDDS-10250. Use SnapshotId as key in SnapshotCache Jan 31, 2024
Copy link
Member

@aswinshakil aswinshakil left a comment

Choose a reason for hiding this comment

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

Thanks for making this change @hemantk-12. The changes mostly look good to me. One more pair of eyes on this should be good. I'll work on HDDS-10265 once this gets merged to complete the whole change.

Copy link
Contributor

@smengcl smengcl left a comment

Choose a reason for hiding this comment

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

Thanks @hemantk-12 . Change looks straight-forward. No compatibility concern as far as can I see since this is OM internal in-memory state. lgtm

@hemantk-12 hemantk-12 force-pushed the HDDS-10250 branch 3 times, most recently from 1e1580c to 59220cb Compare February 9, 2024 23:53

// Block snapshot from loading when it is no longer active e.g. DELETED,
// unless this is called from SnapshotDeletingService.
checkSnapshotActive(snapshotInfo, true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aswinshakil this is not needed. Please correct me if I'm wrong.

Copy link
Member

Choose a reason for hiding this comment

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

We needed it as a rail guard so that DELETED snapshot is not loaded by other services. But I don't think we would need it. Reason is that we already block FS calls to snapshot, We check snapshot status in snapDiff for each page. Make sense to remove this.

Copy link
Member

@aswinshakil aswinshakil 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. Thanks for the patch @hemantk-12

@hemantk-12 hemantk-12 merged commit c35e99f into apache:master Feb 10, 2024
35 checks passed
@hemantk-12
Copy link
Contributor Author

Thanks @aswinshakil and @smengcl for the review.

xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
@hemantk-12 hemantk-12 deleted the HDDS-10250 branch October 28, 2024 18:40
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.

3 participants