[
https://issues.apache.org/jira/browse/HADOOP-18801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17743205#comment-17743205
]
ASF GitHub Bot commented on HADOOP-18801:
-----------------------------------------
ayushtkn commented on code in PR #5744:
URL: https://github.com/apache/hadoop/pull/5744#discussion_r1263885805
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/TrashPolicyDefault.java:
##########
@@ -374,8 +382,14 @@ private void deleteCheckpoint(Path trashRoot, boolean
deleteImmediately)
try {
time = getTimeFromCheckpoint(name);
} catch (ParseException e) {
- LOG.warn("Unexpected item in trash: "+dir+". Ignoring.");
- continue;
+ if (cleanNonCheckpointUnderTrashRoot) {
+ fs.delete(path, true);
+ LOG.warn("Unexpected item in trash: " + dir + ". Force to delete
it.");
Review Comment:
can we change to
```
LOG.warn("Unexpected item in trash: " + dir + ". Deleting.");
```
##########
hadoop-common-project/hadoop-common/src/main/resources/core-default.xml:
##########
@@ -974,6 +974,14 @@
</description>
</property>
+<property>
+ <name>fs.trash.clean.trashroot.enable</name>
+ <value>false</value>
+ <description>Whether clean some directories or files
+ at home of Trash which are not under checkpoint directory or not.
+ </description>
Review Comment:
some error in language, can we change it something like
```
Whether to delete directories and files in Trash home which are not under
checkpoint directory
```
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestTrash.java:
##########
@@ -786,6 +787,55 @@ public void testTrashEmptier() throws Exception {
emptierThread.join();
}
+ /**
+ * Test trash emptier can whether delete non-checkpoint dir or not.
Review Comment:
typo: can & whether don't go together
```
Test trash emptier can delete non-checkpoint dir or not.
```
> Delete path directly when it can not be parsed in trash
> -------------------------------------------------------
>
> Key: HADOOP-18801
> URL: https://issues.apache.org/jira/browse/HADOOP-18801
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: farmmamba
> Assignee: farmmamba
> Priority: Major
> Labels: pull-request-available
>
> If we move path to trash dir directly rather than use delete API or rm
> command, when
> invoke deleteCheckpoint method, it will catch ParseException and ignore
> deleting the path. It will never be deleted, so we should do something to
> prevent or monitor it.
> Some logs are listed below.
>
> {code:java}
> WARN org.apache.hadoop.fs.TrashPolicyDefault: Unexpected item in trash:
> /user/de_eight/.Trash/college_geek_job_recall_als_modelres_5_2_6.del.
> Ignoring.
> WARN org.apache.hadoop.fs.TrashPolicyDefault: Unexpected item in trash:
> /user/de_eight/.Trash/college_geek_addf_vector. Ignoring.
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]