[
https://issues.apache.org/jira/browse/HDFS-8540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584354#comment-14584354
]
Tsz Wo Nicholas Sze commented on HDFS-8540:
-------------------------------------------
The patch looks good. Just some minor comments:
- remove "public" from the methods in Result.
- add a Result.getExitStatus() method as below.
{code}
/**
* @return SUCCESS if all moves are success and there is no remaining move.
* Return NO_MOVE_BLOCK if there moves available but all the moves
* cannot be scheduled. Otherwise, there some success moves and some
* remaining moves, return IN_PROGRESS
*/
ExitStatus getExitStatus() {
return isNoBlockMoved()? ExitStatus.NO_MOVE_BLOCK
: isHasRemaining()? ExitStatus.IN_PROGRESS: ExitStatus.SUCCESS;
}
{code}
Then, run() can return directly
{code}
return new Processor().processNamespace().getExitStatus();
{code}
- there is a unused import org.apache.hadoop.fs.BlockStoragePolicySpi. Could
you remove it as well?
> Mover should exit with NO_MOVE_BLOCK if no block can be moved
> -------------------------------------------------------------
>
> Key: HDFS-8540
> URL: https://issues.apache.org/jira/browse/HDFS-8540
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: balancer & mover
> Reporter: Tsz Wo Nicholas Sze
> Assignee: surendra singh lilhore
> Attachments: HDFS-8540.patch, HDFS-8540_1.patch
>
>
> When there are files not satisfying their storage policy and no move is
> possible, Mover exits with SUCCESS. It should exit with NO_MOVE_BLOCK.
> The bug seems in the following code. When StorageTypeDiff is not empty and
> scheduleMoves4Block return false, it does not update hasRemaining. Also,
> there is no indication of "No block can be moved" for the entire iteration.
> {code}
> //Mover.processFile(..)
> if (!diff.removeOverlap(true)) {
> if (scheduleMoves4Block(diff, lb, ecSchema)) {
> hasRemaining |= (diff.existing.size() > 1 &&
> diff.expected.size() > 1);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)