-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-13070. OM Follower changes to create and place sst files from hardlink file. #8761
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
Conversation
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotUtils.java
Outdated
Show resolved
Hide resolved
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotUtils.java
Outdated
Show resolved
Hide resolved
smengcl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the most critical thing this patch does is switching to OMDBCheckpointServletInodeBasedXfer. Apart from that there is a minor factoring for source files clean up.
+1. Pls take care of @jojochuang 's comment as well before we merge this.
|
Does not compile! |
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotUtils.java
Show resolved
Hide resolved
|
The test failure looks related to the change, I'm checking this. |
|
There are fewer test errors but still a few left. |
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements changes to enable OM Follower to create and place SST files from hardlink files, setting the default servlet provider to OMDBCheckpointServletInodeBasedXfer. The implementation adds functionality to delete source files after creating hardlinks and updates the file handling logic to work with general files rather than just SST files.
Key changes:
- Modified
createHardLinksmethod to optionally delete source files after creating hardlinks - Updated file scanning logic from SST-specific to general file handling
- Changed default servlet to use inode-based transfer mechanism
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| OmSnapshotUtils.java | Enhanced createHardLinks method with source file deletion capability and improved error handling |
| HAUtils.java | Renamed and generalized getExistingSstFiles to getExistingFiles for broader file type support |
| OzoneManagerHttpServer.java | Changed default servlet from OMDBCheckpointServlet to OMDBCheckpointServletInodeBasedXfer |
| Multiple test files | Updated method calls and test logic to use the new file handling approach |
| OMDBCheckpointServletInodeBasedXfer.java | Simplified logging parameter from excludedSstList to receivedSstFiles |
Comments suppressed due to low confidence (1)
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java:334
- The variable 'sstList' is misleading since the method now returns all files, not just SST files. It should be renamed to 'fileList' or similar to reflect its actual content.
sstList = files.filter(p -> p.toFile().isFile())
...p-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OmSnapshotUtils.java
Outdated
Show resolved
Hide resolved
...op-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java
Show resolved
Hide resolved
...op-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/HAUtils.java
Outdated
Show resolved
Hide resolved
hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/TestRDBSnapshotProvider.java
Outdated
Show resolved
Hide resolved
jojochuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few minior suggestions that can be address later.
| * @return the list of file names. If db not exist, will return empty list | ||
| */ | ||
| public static List<String> getExistingSstFiles(File db) throws IOException { | ||
| public static List<String> getExistingFiles(File db) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest getExistingFiles() shouldn't be in the HAUtils. Instead it belongs to RocksDBUtils.
| sstList = | ||
| files.filter(path -> path.toString().endsWith(ROCKSDB_SST_SUFFIX)). | ||
| map(p -> p.toString().substring(truncateLength)). | ||
| sstList = files.filter(p -> p.toFile().isFile()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A potential problem is flagged by Gemini: the files object could contain relative path rather than the file name only. It's okay though for rocksdb as the directory is flat with no subdirectories.
|
Thanks @SaketaChalamchala and @sadanand48 ! |
|
When merging PRs, please remove co-author information if it's the same person with different email address. |
* master: (730 commits) HDDS-13083. Handle cases where block deletion generates tree file before scanner (apache#8565) HDDS-12982. Reduce log level for snapshot validation failure (apache#8851) HDDS-13396. Documentation: Improve the top-level overview page for new users. (apache#8753) HDDS-13176. containerIds table value format change to proto from string (apache#8589) HDDS-13449. Incorrect Interrupt Handling for DirectoryDeletingService and KeyDeletingService (apache#8817) HDDS-2453. Add Freon tests for S3 MPU Keys (apache#8803) HDDS-13237. Container data checksum should contain block IDs. (apache#8773) HDDS-13489. Fix SCMBlockdeleting unnecessary iteration in corner case. (apache#8847) HDDS-13464. Make ozone.snapshot.filtering.service.interval reconfigurable (apache#8825) HDDS-13473. Amend validation for OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES (apache#8829) HDDS-13435. Add an OzoneManagerAuthorizer interface (apache#8840) HDDS-8565. Recon memory leak in NSSummary (apache#8823). HDDS-12852. Implement a sliding window counter utility (apache#8498) HDDS-12000. Add unit test for RatisContainerSafeModeRule and ECContainerSafeModeRule (apache#8801) HDDS-13092. Container scanner should trigger volume scan when marking a container unhealthy (apache#8603) HDDS-13070. OM Follower changes to create and place sst files from hardlink file. (apache#8761) HDDS-13482. Mark testWriteStateMachineDataIdempotencyWithClosedContainer as flaky HDDS-13481. Fix success latency metric in SCM panels of deletion grafana dashboard (apache#8835) HDDS-13468. Update default value of ozone.scm.ha.dbtransactionbuffer.flush.interval. (apache#8834) HDDS-13410. Control block deletion for each DN from SCM. (apache#8767) ... hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReplicaInfo.java hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ReconcileSubcommand.java hadoop-ozone/cli-admin/src/test/java/org/apache/hadoop/hdds/scm/cli/container/TestReconcileSubcommand.java
…rdlink file. (apache#8761) Co-authored-by: Sadanand Shenoy <[email protected]>
… from hardlink file. (apache#8761)" This reverts commit c98c10b. Conflicts: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java Change-Id: Ie562cb0b08b60c6451bac23051807b303d77bb9d
… from hardlink file. (apache#8761)" This reverts commit c98c10b. Conflicts: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java Change-Id: Ie562cb0b08b60c6451bac23051807b303d77bb9d
… from hardlink file. (#8761)" This reverts commit c98c10b. Conflicts: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java Change-Id: Ie562cb0b08b60c6451bac23051807b303d77bb9d
What changes were proposed in this pull request?
OM Follower changes to create and place sst files from hardlink file. This sets the default servlet provider as OMDBCheckpointServletInodeBasedXfer
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-13070
How was this patch tested?
Existing unit tests i.e TestOMRatisSnapshots/TestOMRatisSnapshotProvider