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

UnsafeAvailChecker should also check that required methods are available

VotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha-1, 2.3.0, 1.7.0, 2.1.10, 2.2.5
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      We had a weird test failure due to accidentally running tests with some Java > 8 (exact version I am unsure of), where Unsafe is available, but the method signatures were different or some methods were removed, leading to this:

      020-05-02 14:57:15,145 ERROR [main] master.HMasterCommandLine: Master exiting
      java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster
          at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:143)
          at org.apache.hadoop.hbase.LocalHBaseCluster.addMaster(LocalHBaseCluster.java:237)
          at org.apache.hadoop.hbase.LocalHBaseCluster.<init>(LocalHBaseCluster.java:163)
          at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:225)
          at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:138)
          at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
          at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:127)
          at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2911)
      Caused by: java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.putInt(java.lang.Object, int, int)'
          at org.apache.hadoop.hbase.util.UnsafeAccess.putInt(UnsafeAccess.java:233)
          at org.apache.hadoop.hbase.util.Bytes$ConverterHolder$UnsafeConverter.putInt(Bytes.java:1499)
          at org.apache.hadoop.hbase.util.Bytes.putInt(Bytes.java:1021)
          at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.appendMetaData(RecoverableZooKeeper.java:850)
          at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.create(RecoverableZooKeeper.java:640)
          at org.apache.hadoop.hbase.zookeeper.ZKUtil.createEphemeralNodeAndWatch(ZKUtil.java:1027)
          at org.apache.hadoop.hbase.zookeeper.MasterAddressTracker.setMasterAddress(MasterAddressTracker.java:211)
          at org.apache.hadoop.hbase.master.HMaster.startActiveMasterManager(HMaster.java:2095)
          at org.apache.hadoop.hbase.master.HMaster.<init>(HMaster.java:520)
          at org.apache.hadoop.hbase.master.HMasterCommandLine$LocalHMaster.<init>(HMasterCommandLine.java:315)
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
          at org.apache.hadoop.hbase.util.JVMClusterUtil.createMasterThread(JVMClusterUtil.java:138)
          ... 7 more
      

      We should also check that all methods that will be invoked on Unsafe in UnsafeAccess.java are available when deciding in UnsafeAvailChecker if Unsafe is available (and usable).

        Attachments

          Activity

            People

            • Assignee:
              apurtell Andrew Kyle Purtell
              Reporter:
              apurtell Andrew Kyle Purtell

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment