HDDS-8748. Reduce DN IO times when deleteChunk (FilePerBlockStrategy)#4821
HDDS-8748. Reduce DN IO times when deleteChunk (FilePerBlockStrategy)#4821xichen01 wants to merge 1 commit intoapache:masterfrom
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @xichen01 for working on this. There are two subtle issues with the patch:
checkFullDeleteis skipped when this method is being called fromdeleteChunks(verifyLength=false). In that caseBlock file to be deleted does not existis not logged. Furthermore, this seems to be the common case (KeyValueHandler.deleteBlock).- As you mention in the description:
For non-existent files ... it prints a log of successful deletions
I'm afraid performance improvement is possible only due to (1).
Thanks for you response. |
|
@xichen01 What I meant is that this statement:
is true only for the case when I'm OK with performing these checks and logging the messages only at debug level, if we can confirm that block deleting service provides other ways to understand what it's doing, or that the messages are basically useless. In other words, we need to balance performance and observability. |
OK, understand. I will close this PR. |
|
Another Maybe Optimization for the In our environment the DN generate 1GB log file just need serval hours. the most of the contents is "Deleted block file: xxx" this can cause logs to be rolled back quickly, and make it difficult to find some others specific log. Do you have any suggestion? |
|
I think a discussion about the possible improvements would be great. |
Hi @xichen01, you can adjust the log4j.properties and add a specific log appender for such classes. |
Thanks for your suggestion. This seems a good idea. |


What changes were proposed in this pull request?
When deleting a file, DN will check whether the Block file to be deleted exists or not in the
FilePerBlockStrategy#deleteChunk.This step of checking for the existence of a Block file can be omitted, and basically does not change the behavior of
FilePerBlockStrategy#deleteChunk.This can reduce the IO-times of
FilePerBlockStrategy#deleteChunkthe
FilePerBlockStrategy#deleteChunkFilePerBlockStrategy#deleteChunkChangeFilePerBlockStrategy#deleteChunkis no change in the result, just one less once IO with System.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8748
How was this patch tested?
existing test