Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-17538

HDFS.setStoragePolicy() logs errors on local fs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • None
    • None
    • Reviewed

    Description

      On a master pseudo-cluster running on local disk, the log contains a lot of these:

      2017-01-25 12:30:41,542 WARN  [StoreOpener-32976c3c9b7c28ad632c041da486bfc3-1] fs.HFileSystem: Failed to set storage policy of [file:/var/folders/h5/bbxg50c12r5bhsd9hf1n9hlr0000gp/T/hbase-enis/hbase/dat
      java.lang.UnsupportedOperationException: Cannot find specified method setStoragePolicy
        at org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:209)
        at org.apache.hadoop.hbase.fs.HFileSystem.setStoragePolicy(HFileSystem.java:161)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:207)
        at org.apache.hadoop.hbase.regionserver.HRegionFileSystem.setStoragePolicy(HRegionFileSystem.java:198)
        at org.apache.hadoop.hbase.regionserver.HStore.<init>(HStore.java:237)
        at org.apache.hadoop.hbase.regionserver.HRegion.instantiateHStore(HRegion.java:5265)
        at org.apache.hadoop.hbase.regionserver.HRegion$1.call(HRegion.java:988)
        at org.apache.hadoop.hbase.regionserver.HRegion$1.call(HRegion.java:985)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoSuchMethodException: org.apache.hadoop.fs.LocalFileSystem.setStoragePolicy(org.apache.hadoop.fs.Path, java.lang.String)
        at java.lang.Class.getMethod(Class.java:1786)
        at org.apache.hadoop.hbase.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:205)
        ... 17 more
      

      These are coming from HFS.setStoragePolicy() or HRegionFS.setStoragePolicy() .

      This check:

      try {
            ReflectionUtils.invokeMethod(this.fs, "setStoragePolicy", storeDir, policyName);
          } catch (Exception e) {
            if (!(this.fs instanceof LocalFileSystem)) {
              LOG.warn("Failed to set storage policy of [" + storeDir + "] to [" + policyName + "]", e);
            }
          }
      

      does not work, because fs is not a LocalFS, but an HFS. And HFS internally does not do this check. seStoragePolicy() is very HDFS specific, the logic should instead check whether the underlying fs is HDFS (as opposed to checking whether it is not local FS). There are file systems that HBase supports other than local or HDFS.

      Attachments

        1. 0002-HBASE-17538-HFS.setStoragePolicy-logs-errors-on-loca.patch
          12 kB
          Michael Stack
        2. HBASE-17538.master.001.patch
          16 kB
          Michael Stack
        3. HBASE-17538.master.002.patch
          20 kB
          Michael Stack
        4. HBASE-17538.master.003.patch
          20 kB
          Michael Stack

        Issue Links

          Activity

            People

              stack Michael Stack
              enis Enis Soztutar
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: