[ https://issues.apache.org/jira/browse/HDFS-15667?focusedWorklogId=508407&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-508407 ]
ASF GitHub Bot logged work on HDFS-15667: ----------------------------------------- Author: ASF GitHub Bot Created on: 06/Nov/20 09:53 Start Date: 06/Nov/20 09:53 Worklog Time Spent: 10m Work Description: hadoop-yetus commented on pull request #2437: URL: https://github.com/apache/hadoop/pull/2437#issuecomment-722987691 :broken_heart: **-1 overall** | Vote | Subsystem | Runtime | Logfile | Comment | |:----:|----------:|--------:|:--------:|:-------:| | +0 :ok: | reexec | 1m 12s | | Docker mode activated. | |||| _ Prechecks _ | | +1 :green_heart: | dupname | 0m 0s | | No case conflicting files found. | | +1 :green_heart: | @author | 0m 0s | | The patch does not contain any @author tags. | | +1 :green_heart: | | 0m 0s | [test4tests](test4tests) | The patch appears to include 1 new or modified test files. | |||| _ trunk Compile Tests _ | | +1 :green_heart: | mvninstall | 32m 14s | | trunk passed | | +1 :green_heart: | compile | 1m 19s | | trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 | | +1 :green_heart: | compile | 1m 12s | | trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | +1 :green_heart: | checkstyle | 0m 53s | | trunk passed | | +1 :green_heart: | mvnsite | 1m 18s | | trunk passed | | +1 :green_heart: | shadedclient | 17m 0s | | branch has no errors when building and testing our client artifacts. | | +1 :green_heart: | javadoc | 0m 53s | | trunk passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 | | +1 :green_heart: | javadoc | 1m 24s | | trunk passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | +0 :ok: | spotbugs | 3m 3s | | Used deprecated FindBugs config; considering switching to SpotBugs. | | +1 :green_heart: | findbugs | 3m 1s | | trunk passed | |||| _ Patch Compile Tests _ | | +1 :green_heart: | mvninstall | 1m 11s | | the patch passed | | +1 :green_heart: | compile | 1m 11s | | the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 | | +1 :green_heart: | javac | 1m 11s | | the patch passed | | +1 :green_heart: | compile | 1m 4s | | the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | +1 :green_heart: | javac | 1m 4s | | the patch passed | | +1 :green_heart: | checkstyle | 0m 44s | | the patch passed | | +1 :green_heart: | mvnsite | 1m 10s | | the patch passed | | +1 :green_heart: | whitespace | 0m 0s | | The patch has no whitespace issues. | | +1 :green_heart: | shadedclient | 14m 36s | | patch has no errors when building and testing our client artifacts. | | +1 :green_heart: | javadoc | 0m 47s | | the patch passed with JDK Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 | | +1 :green_heart: | javadoc | 1m 20s | | the patch passed with JDK Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | +1 :green_heart: | findbugs | 3m 5s | | the patch passed | |||| _ Other Tests _ | | -1 :x: | unit | 128m 17s | [/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2437/5/artifact/out/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt) | hadoop-hdfs in the patch passed. | | +1 :green_heart: | asflicense | 0m 42s | | The patch does not generate ASF License warnings. | | | | 216m 34s | | | | Reason | Tests | |-------:|:------| | Failed junit tests | hadoop.hdfs.TestDFSInotifyEventInputStreamKerberized | | | hadoop.hdfs.TestGetFileChecksum | | Subsystem | Report/Notes | |----------:|:-------------| | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2437/5/artifact/out/Dockerfile | | GITHUB PR | https://github.com/apache/hadoop/pull/2437 | | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle | | uname | Linux c4081bb771d0 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | dev-support/bin/hadoop.sh | | git revision | trunk / 4b312810ae0 | | Default Java | Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.9+11-Ubuntu-0ubuntu1.18.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_272-8u272-b10-0ubuntu1~18.04-b10 | | Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2437/5/testReport/ | | Max. process+thread count | 4181 (vs. ulimit of 5500) | | modules | C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs | | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-2437/5/console | | versions | git=2.17.1 maven=3.6.0 findbugs=4.1.3 | | Powered by | Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org | This message was automatically generated. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 508407) Time Spent: 3h 40m (was: 3.5h) > Audit log record the unexpected allowed result when delete called > ----------------------------------------------------------------- > > Key: HDFS-15667 > URL: https://issues.apache.org/jira/browse/HDFS-15667 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs > Affects Versions: 3.2.1, 3.4.0 > Reporter: Baolong Mao > Assignee: Baolong Mao > Priority: Major > Labels: pull-request-available > Attachments: screenshot-1.png, screenshot-2.png > > Time Spent: 3h 40m > Remaining Estimate: 0h > > I met this issue if rm root directory, for remove non-root and non-empty > directory, toRemovedBlocks isn't null, its toDeleteList size is 0. > !screenshot-1.png! > when will return null? > Through this screenshot, we can find that if fileRemoved = -1, then > toRemovedBlocks = null > !screenshot-2.png! > And when deleteAllowed(iip) return false, fileRemoved can be -1, > {code:java} > private static boolean deleteAllowed(final INodesInPath iip) { > if (iip.length() < 1 || iip.getLastINode() == null) { > if (NameNode.stateChangeLog.isDebugEnabled()) { > NameNode.stateChangeLog.debug( > "DIR* FSDirectory.unprotectedDelete: failed to remove " > + iip.getPath() + " because it does not exist"); > } > return false; > } else if (iip.length() == 1) { // src is the root > NameNode.stateChangeLog.warn( > "DIR* FSDirectory.unprotectedDelete: failed to remove " + > iip.getPath() + " because the root is not allowed to be > deleted"); > return false; > } > return true; > } > {code} > Through the code of deleteAllowed, we can find that when src is the root, it > can return false. > So without this PR, when I execute *bin/hdfs dfs -rm -r /* > I find the confusing auditlog line like following > 2020-11-05 14:32:53,420 INFO FSNamesystem.audit > (FSNamesystem.java:logAuditMessage(8102)) - allowed=true -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org