Dave Beckett created AMBARI-11952:
-------------------------------------

             Summary: get_mount_point_for_dir does not always calculate the 
right mount point
                 Key: AMBARI-11952
                 URL: https://issues.apache.org/jira/browse/AMBARI-11952
             Project: Ambari
          Issue Type: Bug
          Components: ambari-agent
    Affects Versions: 2.0.1
            Reporter: Dave Beckett
            Priority: Minor


get_mount_point_for_dir() mount checking code calculates that the best disk 
partition for a data directory /diskN/hadoop/dfs under a disk mounted at /diskN 
as / rather than the expected answer /diskN.

This is because the number of separators (slashes) in '/' is 1 and the number 
of them in '/diskN' is also 1, and root tends to be first in mount(1) output, 
so it wins.

This code here should count the number of non-None path segments, not the 
number of separators.  In python terms, the name with the maximum len([x for x 
in best_mount_found.split(os.path.sep) where x is not None])

This was found while researching AMBARI-11951



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to