Skip to content

Conversation

@aswinshakil
Copy link
Member

What changes were proposed in this pull request?

The original patch #5579 was reverted due to incompatible proto.lock changes and hence reverted in #6051. The proto.lock is now merged to master in #6080 . Hence re-raising the PR. Copying the original PR description here for context.

Original PR description

In #5339, We expanded the snapshot's deletedDirTable into fileTable to calculate the exclusive size for the files under the deleted directories. The problem with that approach is that if we alter the fileTable and dirTable of a snapshot, it would change the snapDiff result and yield undesirable results. For eg, Consider a deleted directory structure as below,

dir1 --- subdir1 --- file1 to file100
    | 
     ---- subdir2 --- file1 to file100

Instead of snapDiff saying DELETED dir1, It would say
DELETED subdir1
DELETED subdir2
DELETED subdir1/file1 to file100
DELETED subdir2/file1 to file100

In the new approach in this patch, We do an in-memory walk for each deleted directory and deep clean them, and also calculate the exclusive size for files when doing so. For each file, we do the same as #5301

The reason we are doing a deep clean, There could be files under a directory trapped in between snapshots. Consider this case,

Create dir1
Create snapshot1
Create 1000 files under dir1 --> These files are trapped and not deleted unless the snapshot itself is deleted.
Delete dir1
Create snapshot2

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9426

How was this patch tested?

Added Integration test.

@aswinshakil aswinshakil self-assigned this Jan 26, 2024
@hemantk-12
Copy link
Contributor

Thanks @aswinshakil for bringing it back.

LGTM.

@adoroszlai adoroszlai changed the title HDDS-9426. Calculate Exclusive size for deep cleaned snapshot's deleted directories. (Re-Raised) HDDS-9426. Calculate Exclusive size for deep cleaned snapshot's deleted directories Jan 26, 2024
@adoroszlai adoroszlai added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Jan 26, 2024
@adoroszlai adoroszlai merged commit 79d3c87 into apache:master Jan 27, 2024
@adoroszlai
Copy link
Contributor

Thanks @aswinshakil for re-working the proto definition to be backwards compatible.

Thanks @hemantk-12 for the review.

xichen01 pushed a commit to xichen01/ozone that referenced this pull request Apr 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Apr 18, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Apr 23, 2024
swamirishi pushed a commit to swamirishi/ozone that referenced this pull request Dec 3, 2025
…shot's deleted directories (apache#6099)

(cherry picked from commit 79d3c87)

 Conflicts:
	hadoop-hdds/common/src/main/resources/ozone-default.xml
	hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java
	hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java
	hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/helpers/TestOmSnapshotInfo.java
	hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotPurgeRequest.java
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotSetPropertyRequest.java
	hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java
	hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/snapshot/TestOMSnapshotSetPropertyRequestAndResponse.java

Change-Id: Ie00cb9f5d675d5730037eb83e1b1220f11d78920
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