-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-7625. Do not compress OM/SCM checkpoints #4130
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
adoroszlai
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.
Thanks @chungen0126 for the patch.
| if (file == null) { | ||
| return; | ||
| } | ||
| response.setContentType("application/x-tgz"); |
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.
| response.setContentType("application/x-tgz"); | |
| response.setContentType("application/x-tar"); |
Also update related tests:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java
182: doNothing().when(responseMock).setContentType("application/x-tgz");
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java
129: doNothing().when(responseMock).setContentType("application/x-tgz");
| try (ArchiveOutputStream archiveOutputStream = | ||
| new TarArchiveOutputStream(destination)) { | ||
|
|
||
| Path checkpointPath = checkpoint.getCheckpointLocation(); | ||
| try (Stream<Path> files = Files.list(checkpointPath)) { | ||
| for (Path path : files.collect(Collectors.toList())) { | ||
| if (path != null) { | ||
| Path fileName = path.getFileName(); | ||
| if (fileName != null) { | ||
| includeFile(path.toFile(), fileName.toString(), | ||
| archiveOutputStream); |
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.
This method and its helper includeFile are duplicated between HddsServerUtil and DBCheckpointServlet. Can you please remove one of them?
Also, please update the method comment (as a compressed file (tgz)) and class comment ((tar.gz)).
| } | ||
|
|
||
| /** | ||
| * Given a source directory, create a tar.gz file from it. |
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.
| * Given a source directory, create a tar.gz file from it. | |
| * Given a source directory, create a tar file from it. |
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.
The change looks good. I think after Attila's comments are addressed this will be good to go.
|
@chungen0126 can you address the comments and rebase the PR? Thank you |
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.
Just one last change and we're goo to go.
| * @throws IOException | ||
| */ | ||
| public static void writeDBCheckpointToStream(DBCheckpoint checkpoint, | ||
| OutputStream destination) |
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.
Let's remove this method, and replace the usage of DBCheckpointServlet.writeDBCheckpointToStream() with HddsServerUtil.writeDBCheckpointToStream(). (There are three usages)
|
|
||
| private static void includeFile(File file, String entryName, | ||
| ArchiveOutputStream archiveOutputStream) | ||
| public static void includeFile(File file, String entryName, |
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.
If DBCheckPointServlet.writeDBCheckpointToStream() is removed, this method should stay private.
| return "container-" + containerId + ".tar"; | ||
| } | ||
|
|
||
| public static long retrieveContainerIdFromTarGzName(String tarGzName) |
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.
can you change the parameter name to tarName
| public static long retrieveContainerIdFromTarGzName(String tarGzName) | |
| public static long retrieveContainerIdFromTarGzName(String tarName) |
| long containerId = 100; | ||
| String tarGzName = "container-100.tar.gz"; | ||
| assertEquals(tarGzName, ContainerUtils.getContainerTarGzName(containerId)); | ||
| String tarGzName = "container-100.tar"; |
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.
| String tarGzName = "container-100.tar"; | |
| String tarName = "container-100.tar"; |
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
* master: (209 commits) HDDS-7097. Container scanner log output lacks useful information (apache#4169) HDDS-7813. Handle Mismatched Replicas (OPEN or CLOSING) of QUASI-CLOSED containers in RM (apache#4195) HDDS-7625. Do not compress OM/SCM checkpoints (apache#4130) HDDS-7801. Bucket not found when calling getKeyInfo with tenant context (apache#4189) HDDS-7807. TarContainerPacker closes streams multiple times (apache#4193) HDDS-7755. Ensure that acquired locks are always released. (apache#4191) HDDS-7804. UNHEALTHY replicas will not contribute to sufficient replication in RatisContainerReplicaCount (apache#4192) HDDS-7748. Rename OMFileRequest.addToOpenFileTable() to avoid misuse. (apache#4176) HDDS-7723. Refresh Keys and Certificate used in OzoneSecretManager after certificate renewed (apache#4179) HDDS-7788. Ratis OverReplicationHandler should exclude stale replicas (apache#4183) HDDS-7718. Bump Netty to 4.1.86 and gRPC to 1.51.1 (apache#4139) HDDS-7542. Refactor DefaultReplicationConfig (apache#4005) HDDS-7787. GetChecksum for EC files can fail intermittently with IndexOutOfBounds exception (apache#4180) HDDS-7754. Download of container is failing with SSL/TLS error during re-replication (apache#4174) HDDS-7455. ClassCastException: OzoneTokenIdentifier cannot be cast to String (apache#4159) HDDS-7441. Rename function names of retrieving metadata keys (apache#3918) HDDS-7722. FSO buckets fail to invalidate open file table cache when committing a key (apache#4156) HDDS-7774. Update outdated Trash documentation (apache#4172) HDDS-7761. EC: ReplicationManager - Use placementPolicy.replicasToRemoveToFixOverreplication in EC Over replication handler (apache#4166) HDDS-7775. EC: Exception encountered while deleting UNHEALTHY replica in Datanode (apache#4173) ...
What changes were proposed in this pull request?
Remove compressing SCM and OM checkpoint. And rename some extensive name from ".tar.gz" to ".tar".
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7625
How was this patch tested?
There are some exsited unit test and integration test.