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-12611. Snapshot creation is removing extra keys from AOS's DB #8094

Merged
merged 1 commit into from
Mar 16, 2025

Conversation

hemantk-12
Copy link
Contributor

@hemantk-12 hemantk-12 commented Mar 15, 2025

What changes were proposed in this pull request?

On snapshot creation, the correct bucket prefix is not used to remove keys from deletedTable of Active Object Storage (AOS)’s DB. Prefix does not end with / (code) which means for snapshot creation on bucket /vol1/buck1, it will move all the keys belonging to bucket /vol1/buck1 and buckets /vol1/buck1[.*]. And keys for buckets /vol1/buck1[.*] will be trapped inside the snapshot and never be reclaimed, causing orphan data blocks because KeytDeletingService and SnapshotDeletingService use the correct bucket prefix.

This change includes:

  • Remove keys from deletedTable by using the correct bucket prefix (ending with /). So that
  • Removed duplicate functions from SnapshotUtils and the same function everywhere.

What is the link to the Apache JIRA

HDDS-12611

How was this patch tested?

Existing test for now. Created HDDS-12612 to add through integration tests for HDDS-12611.

Copy link
Contributor

@swamirishi swamirishi 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 the patch @hemantk-12 Changes look good to me.

@@ -499,8 +498,7 @@ private static void deleteKeysFromDelDirTableInSnapshotScope(
String bucketName, BatchOperation batchOperation) throws IOException {

// Range delete start key (inclusive)
final String keyPrefix = getOzonePathKeyForFso(omMetadataManager,
volumeName, bucketName);
final String keyPrefix = omMetadataManager.getBucketKeyPrefixFSO(volumeName, bucketName);
Copy link
Contributor

Choose a reason for hiding this comment

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

We should eventually move all fo these to KeyManager class eventually

Copy link
Contributor

Choose a reason for hiding this comment

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

we will do this as part of GC refactoring fixes

@ivandika3
Copy link
Contributor

Thanks for the patch, just wondering what does AOS stands for? I saw it in snapshot-related patches, but I'm still not sure what it means.

Thanks in advance.

@hemantk-12
Copy link
Contributor Author

hemantk-12 commented Mar 16, 2025

Thanks for the patch, just wondering what does AOS stands for? I saw it in snapshot-related patches, but I'm still not sure what it means.

AOS stands for Active Object Storage (and AFS stands for Active File System).

@adoroszlai adoroszlai added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Mar 16, 2025
@swamirishi
Copy link
Contributor

Thank you for working on the patch @hemantk-12 and thank you @ivandika3 for reviewing the patch. We can merge this patch given it is quite straightforward and create a follow up if at all there is some other problem which shouldn't be the case mostly

@swamirishi swamirishi merged commit dc47897 into apache:master Mar 16, 2025
44 checks passed
@ivandika3
Copy link
Contributor

Thanks @swamirishi , I have resolved the ticket accordingly.

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.

4 participants