[ https://issues.apache.org/jira/browse/HDFS-15362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17117995#comment-17117995 ]
Hudson commented on HDFS-15362: ------------------------------- SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #18300 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/18300/]) HDFS-15362. FileWithSnapshotFeature#updateQuotaAndCollectBlocks should (inigoiri: rev 2148a8fe645333444c4e8110bb56acf0fb8e41b4) * (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/snapshot/FileWithSnapshotFeature.java * (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestFileWithSnapshotFeature.java > FileWithSnapshotFeature#updateQuotaAndCollectBlocks should collect all > distinct blocks > -------------------------------------------------------------------------------------- > > Key: HDFS-15362 > URL: https://issues.apache.org/jira/browse/HDFS-15362 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: hemanthboyina > Assignee: hemanthboyina > Priority: Major > Fix For: 3.4.0 > > Attachments: HDFS-15362.001.patch, HDFS-15362.002.patch > > > FileWithSnapshotFeature#updateQuotaAndCollectBlocks uses list to collect > blocks > {code:java} > List<BlockInfo> allBlocks = new ArrayList<BlockInfo>(); > if (file.getBlocks() != null) { > allBlocks.addAll(Arrays.asList(file.getBlocks())); > }{code} > INodeFile#storagespaceConsumedContiguous collects all distinct blocks by set > {code:java} > // Collect all distinct blocks > Set<BlockInfo> allBlocks = new HashSet<>(Arrays.asList(getBlocks())); > DiffList<FileDiff> diffs = sf.getDiffs().asList(); > for(FileDiff diff : diffs) { > BlockInfo[] diffBlocks = diff.getBlocks(); > if (diffBlocks != null) { > allBlocks.addAll(Arrays.asList(diffBlocks)); > } {code} > but on updating the reclaim context we subtract these both , so wrong quota > value can be updated > {code:java} > QuotaCounts current = file.storagespaceConsumed(bsp); > reclaimContext.quotaDelta().add(oldCounts.subtract(current)); {code} -- 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