[ https://issues.apache.org/jira/browse/HDFS-15877?focusedWorklogId=597502&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-597502 ]
ASF GitHub Bot logged work on HDFS-15877: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/May/21 08:41 Start Date: 17/May/21 08:41 Worklog Time Spent: 10m Work Description: haiyang1987 edited a comment on pull request #2747: URL: https://github.com/apache/hadoop/pull/2747#issuecomment-842136488 @ferhui Thanks for reviewing. This does not seem to cause any problems in production, However in this case the debug log output execution information is a problem. > BlockManager#computeReconstructionWorkForBlocks int computeReconstructionWorkForBlocks( List<List<BlockInfo>> blocksToReconstruct) { ... if (blockLog.isDebugEnabled()) { // log which blocks have been scheduled for reconstruction for (BlockReconstructionWork rw : reconWork) { DatanodeStorageInfo[] targets = rw.getTargets(); if (targets != null && targets.length != 0) { StringBuilder targetList = new StringBuilder("datanode(s)"); for (DatanodeStorageInfo target : targets) { targetList.append(' ').append(target.getDatanodeDescriptor()); } blockLog.debug("BLOCK* ask {} to replicate {} to {}", rw.getSrcNodes(), rw.getBlock(), targetList); } ... > -- 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: 597502) Time Spent: 1h 10m (was: 1h) > BlockReconstructionWork should resetTargets() before > BlockManager#validateReconstructionWork return false > --------------------------------------------------------------------------------------------------------- > > Key: HDFS-15877 > URL: https://issues.apache.org/jira/browse/HDFS-15877 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Haiyang Hu > Assignee: Haiyang Hu > Priority: Minor > Labels: pull-request-available > Time Spent: 1h 10m > Remaining Estimate: 0h > > BlockReconstructionWork should resetTargets() before > BlockManager#validateReconstructionWork return false > the related code is in BlockManager.java > {code:java} > // code placeholder > private boolean validateReconstructionWork(BlockReconstructionWork rw) { > BlockInfo block = rw.getBlock(); > int priority = rw.getPriority(); > ... > if (block.isDeleted() || !block.isCompleteOrCommitted()) { > neededReconstruction.remove(block, priority); > rw.resetTargets(); > return false; > } > // do not schedule more if enough replicas is already pending > ... > if (hasEnoughEffectiveReplicas(block, numReplicas, pendingNum)) { > neededReconstruction.remove(block, priority); > rw.resetTargets(); > blockLog.debug("BLOCK* Removing {} from neededReconstruction as" + > " it has enough replicas", block); > return false; > } > DatanodeStorageInfo[] targets = rw.getTargets(); > BlockPlacementStatus placementStatus = getBlockPlacementStatus(block); > if ((numReplicas.liveReplicas() >= requiredRedundancy) && > (!placementStatus.isPlacementPolicySatisfied())) { > BlockPlacementStatus newPlacementStatus = > getBlockPlacementStatus(block, targets); > if (!newPlacementStatus.isPlacementPolicySatisfied() && > (newPlacementStatus.getAdditionalReplicasRequired() >= > placementStatus.getAdditionalReplicasRequired())) { > ... > //Here to add rw.resetTargets(); > return false; > } > > rw.setNotEnoughRack(); > } > ... > return true; > } > {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