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

Fix pre and post hooks of CloneSnapshot and RestoreSnapshot for Access checks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 3.0.0-alpha-1, 2.1.0, 2.0.2
    • security
    • None
    • Reviewed

    Description

      romil.choksi found this issue during the testing.

      Steps to repro:
      1) create a test namespace
      2) grant 'CA' permission on that namespace to test user
      3) access hbase shell as that test user, and create a table in that namespace
      4) load some data into the test table
      5) create a snapshot as test user for that test table
      6) disable table
      7) as test user, try restoring the snapshot onto test table
      restore_snapshot command for the test user requiring to have global admin access

      root@ctr-e138-1518143905142-384164-01-000002:~# su - hbase
      hbase@ctr-e138-1518143905142-384164-01-000002:~$ kinit -kt /etc/security/keytabs/hbase.headless.keytab hbase@EXAMPLE.COM
      hbase@ctr-e138-1518143905142-384164-01-000002:~$ hbase shell
      HBase Shell
      Use "help" to get list of supported commands.
      Use "exit" to quit this interactive shell.
      Version 2.0.0.3.0.0.0-1565, r34730e8c13ca0887c591aef113590f4065d28964, Thu Jun 28 04:17:55 UTC 2018
      Took 0.0021 seconds                                                                                                                                                                                                                                                                                                                                                         
      hbase(main):001:0> create_namespace 'test1'
      Took 0.8544 seconds                                                                                                                                                                                                                                                                                                                                                         
      hbase(main):002:0> grant 'hrt_1', 'CA', '@test1'
      Took 0.5769 seconds                                                                                                                                                                                                                                                                                                                                                         
      hbase(main):003:0> exit
      hbase@ctr-e138-1518143905142-384164-01-000002:~$ exit
      logout
      ....
      ....
      ....
      ....
      hrt_1@ctr-e138-1518143905142-384164-01-000002:~$ kinit -kt /home/hrt_qa/hadoopqa/keytabs/hrt_1.headless.keytab hrt_1@EXAMPLE.COM
      hrt_1@ctr-e138-1518143905142-384164-01-000002:~$ hbase shell
      HBase Shell
      Use "help" to get list of supported commands.
      Use "exit" to quit this interactive shell.
      Version 2.0.0.3.0.0.0-1565, r34730e8c13ca0887c591aef113590f4065d28964, Thu Jun 28 04:17:55 UTC 2018
      Took 0.0022 seconds
      hbase(main):002:0> create 'test1:test_table', 'cf'
      Created table test1:test_table
      Took 1.8945 seconds                                                                                                                                                                                                                                                                                                                                                         
      => Hbase::Table - test1:test_table
      hbase(main):005:0> put 'test1:test_table', 'r1', 'cf:c1', 'v1'
      Took 0.0634 seconds                                                                                                                                                                                                                                                                                                                                                         
      hbase(main):006:0> put 'test1:test_table', 'r2', 'cf:c1', 'v2'
      Took 0.0054 seconds 
      hbase(main):002:0> snapshot 'test1:test_table', 'snapshot_test_table'
      Took 1.1845 seconds 
      hbase(main):004:0> disable 'test1:test_table'
      Took 0.4818 seconds     
      hbase(main):005:0> restore_snapshot 'snapshot_test_table'
      2018-06-28 20:44:08,639 ERROR [main] client.HBaseAdmin: Failed to restore and rollback to snapshot=hbase-failsafe-snapshot_test_table-1530218648054
      org.apache.hadoop.hbase.security.AccessDeniedException: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions for user 'hrt_1' (global, action=ADMIN)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requireGlobalPermission(AccessChecker.java:158)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requirePermission(AccessChecker.java:129)
      	at org.apache.hadoop.hbase.security.access.AccessController.preRestoreSnapshot(AccessController.java:1182)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1072)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost$ObserverOperationWithoutResult.callObserver(CoprocessorHost.java:540)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.execOperation(CoprocessorHost.java:614)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost.preRestoreSnapshot(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreSnapshot(SnapshotManager.java:831)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreOrCloneSnapshot(SnapshotManager.java:794)
      	at org.apache.hadoop.hbase.master.HMaster$14.run(HMaster.java:2439)
      	at org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil.submitProcedure(MasterProcedureUtil.java:131)
      	at org.apache.hadoop.hbase.master.HMaster.restoreSnapshot(HMaster.java:2434)
      	at org.apache.hadoop.hbase.master.MasterRpcServices.restoreSnapshot(MasterRpcServices.java:1389)
      	at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
      	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:409)
      	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:131)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304)
      
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.apache.hadoop.hbase.ipc.RemoteWithExtrasException.instantiateException(RemoteWithExtrasException.java:100)
      	at org.apache.hadoop.hbase.ipc.RemoteWithExtrasException.unwrapRemoteException(RemoteWithExtrasException.java:90)
      	at org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil.makeIOExceptionOfException(ProtobufUtil.java:359)
      	at org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil.handleRemoteException(ProtobufUtil.java:347)
      	at org.apache.hadoop.hbase.client.MasterCallable.call(MasterCallable.java:101)
      	at org.apache.hadoop.hbase.client.RpcRetryingCallerImpl.callWithRetries(RpcRetryingCallerImpl.java:107)
      	at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3079)
      	at org.apache.hadoop.hbase.client.HBaseAdmin.executeCallable(HBaseAdmin.java:3071)
      	at org.apache.hadoop.hbase.client.HBaseAdmin.internalRestoreSnapshotAsync(HBaseAdmin.java:2864)
      	at org.apache.hadoop.hbase.client.HBaseAdmin.restoreSnapshot(HBaseAdmin.java:2690)
      	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:498)
      	at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:423)
      	at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:290)
      	at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:28)
      	at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:90)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.RubyClass.finvoke(RubyClass.java:523)
      	at org.jruby.RubyBasicObject.send19(RubyBasicObject.java:1684)
      	at org.jruby.RubyKernel.send19(RubyKernel.java:2018)
      	at org.jruby.RubyKernel$INVOKER$s$send19.call(RubyKernel$INVOKER$s$send19.gen)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
      	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:149)
      	at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
      	at org.jruby.runtime.Block.yieldSpecific(Block.java:134)
      	at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:421)
      	at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:117)
      	at org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:171)
      	at org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:195)
      	at org.jruby.RubyKernel.evalCommon(RubyKernel.java:1028)
      	at org.jruby.RubyKernel.eval19(RubyKernel.java:995)
      	at org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
      	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:149)
      	at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
      	at org.jruby.runtime.Block.yieldSpecific(Block.java:134)
      	at org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:421)
      	at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
      	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
      	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:149)
      	at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:193)
      	at org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
      	at org.jruby.runtime.Block.yieldValues(Block.java:181)
      	at org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:80)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
      	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:149)
      	at org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
      	at org.jruby.runtime.Block.yieldSpecific(Block.java:134)
      	at org.jruby.RubyKernel.loop(RubyKernel.java:1316)
      	at org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(RubyKernel$INVOKER$s$0$0$loop.gen)
      	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:536)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
      	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:149)
      	at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
      	at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
      	at org.jruby.runtime.Block.yield(Block.java:165)
      	at org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
      	at org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1145)
      	at org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1138)
      	at org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
      	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
      	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
      	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
      	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
      	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:194)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.invokeOther142:eval_input(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:188)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.RUBY$block$start$9(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:188)
      	at org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
      	at org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
      	at org.jruby.runtime.Block.yield(Block.java:165)
      	at org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
      	at org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1145)
      	at org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1138)
      	at org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
      	at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.invokeOther184:catch(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:187)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.RUBY$method$start$8(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:187)
      	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)
      	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:152)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.invokeOther187:start(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:193)
      	at usr.hdp.$3_dot_0_dot_0_dot_0_minus_1565.hbase.bin.hirb.RUBY$script(/usr/hdp/3.0.0.0-1565/hbase/bin/hirb.rb:193)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.jruby.ir.Compiler$1.load(Compiler.java:94)
      	at org.jruby.Ruby.runScript(Ruby.java:830)
      	at org.jruby.Ruby.runNormally(Ruby.java:749)
      	at org.jruby.Ruby.runNormally(Ruby.java:767)
      	at org.jruby.Ruby.runFromMain(Ruby.java:580)
      	at org.jruby.Main.doRunFromMain(Main.java:417)
      	at org.jruby.Main.internalRun(Main.java:305)
      	at org.jruby.Main.run(Main.java:232)
      	at org.jruby.Main.main(Main.java:204)
      Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException(org.apache.hadoop.hbase.security.AccessDeniedException): org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions for user 'hrt_1' (global, action=ADMIN)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requireGlobalPermission(AccessChecker.java:158)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requirePermission(AccessChecker.java:129)
      	at org.apache.hadoop.hbase.security.access.AccessController.preRestoreSnapshot(AccessController.java:1182)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1072)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost$ObserverOperationWithoutResult.callObserver(CoprocessorHost.java:540)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.execOperation(CoprocessorHost.java:614)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost.preRestoreSnapshot(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreSnapshot(SnapshotManager.java:831)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreOrCloneSnapshot(SnapshotManager.java:794)
      	at org.apache.hadoop.hbase.master.HMaster$14.run(HMaster.java:2439)
      	at org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil.submitProcedure(MasterProcedureUtil.java:131)
      	at org.apache.hadoop.hbase.master.HMaster.restoreSnapshot(HMaster.java:2434)
      	at org.apache.hadoop.hbase.master.MasterRpcServices.restoreSnapshot(MasterRpcServices.java:1389)
      	at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
      	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:409)
      	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:131)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304)
      
      	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.onCallFinished(AbstractRpcClient.java:387)
      	at org.apache.hadoop.hbase.ipc.AbstractRpcClient.access$100(AbstractRpcClient.java:95)
      	at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:410)
      	at org.apache.hadoop.hbase.ipc.AbstractRpcClient$3.run(AbstractRpcClient.java:406)
      	at org.apache.hadoop.hbase.ipc.Call.callComplete(Call.java:103)
      	at org.apache.hadoop.hbase.ipc.Call.setException(Call.java:118)
      	at org.apache.hadoop.hbase.ipc.NettyRpcDuplexHandler.readResponse(NettyRpcDuplexHandler.java:161)
      	at org.apache.hadoop.hbase.ipc.NettyRpcDuplexHandler.channelRead(NettyRpcDuplexHandler.java:191)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
      	at org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at org.apache.hbase.thirdparty.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      	at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      	at org.apache.hbase.thirdparty.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      	at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935)
      	at org.apache.hbase.thirdparty.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:138)
      	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
      	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
      	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
      	at org.apache.hbase.thirdparty.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
      	at org.apache.hbase.thirdparty.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
      	at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
      	at java.lang.Thread.run(Thread.java:745)
      
      ERROR: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions for user 'hrt_1' (global, action=ADMIN)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requireGlobalPermission(AccessChecker.java:158)
      	at org.apache.hadoop.hbase.security.access.AccessChecker.requirePermission(AccessChecker.java:129)
      	at org.apache.hadoop.hbase.security.access.AccessController.preRestoreSnapshot(AccessController.java:1182)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1072)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost$78.call(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost$ObserverOperationWithoutResult.callObserver(CoprocessorHost.java:540)
      	at org.apache.hadoop.hbase.coprocessor.CoprocessorHost.execOperation(CoprocessorHost.java:614)
      	at org.apache.hadoop.hbase.master.MasterCoprocessorHost.preRestoreSnapshot(MasterCoprocessorHost.java:1069)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreSnapshot(SnapshotManager.java:831)
      	at org.apache.hadoop.hbase.master.snapshot.SnapshotManager.restoreOrCloneSnapshot(SnapshotManager.java:794)
      	at org.apache.hadoop.hbase.master.HMaster$14.run(HMaster.java:2439)
      	at org.apache.hadoop.hbase.master.procedure.MasterProcedureUtil.submitProcedure(MasterProcedureUtil.java:131)
      	at org.apache.hadoop.hbase.master.HMaster.restoreSnapshot(HMaster.java:2434)
      	at org.apache.hadoop.hbase.master.MasterRpcServices.restoreSnapshot(MasterRpcServices.java:1389)
      	at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
      	at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:409)
      	at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:131)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)
      	at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304)
      
      Restore a specified snapshot.
      The restore will replace the content of the original table,
      bringing back the content to the snapshot state.
      The table must be disabled.
      
      Examples:
        hbase> restore_snapshot 'snapshotName'
      
      Following command will restore all acl from snapshot table into the table.
      
        hbase> restore_snapshot 'snapshotName', {RESTORE_ACL=>true}
      
      Took 0.6327 seconds 
      

      Attachments

        1. HBASE-20825.patch
          1 kB
          Ankit Singhal

        Activity

          People

            ankit@apache.org Ankit Singhal
            romil.choksi Romil Choksi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: