Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13683

HDFS StoragePolicy commands should work with Federation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: hdfs, tools
    • Labels:
      None

      Description

      In a federated cluster (defaultFS = viewfs://cluster3), getStoragePolicy with hdfs uri will run into the following error:

      [root@cdh6-0-0-centos73-17443-1 ~]# hdfs storagepolicies -getStoragePolicy -path hdfs://ns2/hbase/WALs/cdh6-0-0-centos73-17443-4.vpc.cloudera.com,22101,1527272361896
      IllegalArgumentException: Wrong FS: hdfs://ns2/hbase/WALs/cdh6-0-0-centos73-17443-4.vpc.cloudera.com,22101,1527272361896, expected: viewfs://cluster3/
      

      Taking a quick look at the code, I think this is the culprit:

       final FileSystem fs = FileSystem.get(conf);
      // should do: final FileSystem fs = p.getFilesystem(conf);
      

      We should have a review of all shell and see if anything else is missing. At the minimum, we should fix all places in StoragePolicyAdmin.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gabor.bota Gabor Bota
                Reporter:
                gabor.bota Gabor Bota
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: