[
https://issues.apache.org/jira/browse/HDFS-6300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14535639#comment-14535639
]
Tsz Wo Nicholas Sze commented on HDFS-6300:
-------------------------------------------
Rakesh, thanks for filing this bug. It was a good catch.
The real fix is "fs.create(idPath, false);". The new
checkAnotherBalancerIsRunning() method is for fail-fast. Some minor comments.
- For the test, the first Balancer may finish and exist before the second
balancer start. So how about simply creating the file but not run the first
balancer? I.e.
{code}
//testManyBalancerSimultaneously() t
FileSystem fs = cluster.getFileSystem(0);
final FSDataOutputStream out = fs.create(Balancer.BALANCER_ID_PATH,
false);
out.writeBytes(InetAddress.getLocalHost().getHostName());
out.hflush();
{code}
- Could you not renaming out to fsout in checkAndMarkRunning().
> Shouldn't allows to run multiple balancer simultaneously
> --------------------------------------------------------
>
> Key: HDFS-6300
> URL: https://issues.apache.org/jira/browse/HDFS-6300
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: balancer & mover
> Reporter: Rakesh R
> Assignee: Rakesh R
> Labels: BB2015-05-RFC
> Attachments: HDFS-6300-001.patch, HDFS-6300-002.patch,
> HDFS-6300-003.patch, HDFS-6300.patch
>
>
> Javadoc of "Balancer.java" says, it will not allow to run second balancer if
> the first one is in progress. But I've noticed multiple can run together and
> balancer.id implementation is not safe guarding.
> {code}
> * <li>Another balancer is running. Exiting...
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)