[ 
https://issues.apache.org/jira/browse/HBASE-22023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16824217#comment-16824217
 ] 

lujie edited comment on HBASE-22023 at 4/23/19 3:05 PM:
--------------------------------------------------------

Hi [~reidchan]

I have tried to add a UT, but the UT always fails at startMiniDFSCluster with 
following exception:
{code:java}
/user/lujie/test-data/0045e29d-91b7-fa38-afaf-046d8bf3e157/.tmp/hbase.version 
could only be replicated to 0 nodes instead of minReplication (=1). There are 1 
datanode(s) running and 1 node(s) are excluded in this operation.
at 
org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1620)
at 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNewBlockTargets(FSNamesystem.java:3135)
at 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3059)
at 
org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:725)
at 
org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:493)
at 
org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at 
org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:982)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2217)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2213)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2211)

{code}
I think the fixing of this bug is straightforward, so can we just fix it 
without UT like HBASE-21740? I will resubmit the patch to trigger check!

 

Thanks!


was (Author: xiaoheipangzi):
Hi [~reidchan]

I have tried to add a UT, but the UT always fails at start startMiniDFSCluster
{code:java}
/user/lujie/test-data/0045e29d-91b7-fa38-afaf-046d8bf3e157/.tmp/hbase.version 
could only be replicated to 0 nodes instead of minReplication (=1). There are 1 
datanode(s) running and 1 node(s) are excluded in this operation.
at 
org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget4NewBlock(BlockManager.java:1620)
at 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getNewBlockTargets(FSNamesystem.java:3135)
at 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:3059)
at 
org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:725)
at 
org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:493)
at 
org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at 
org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:616)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:982)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2217)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2213)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2211)

{code}
I think the fixing of this bug is straightforward, so can we just fix it 
without UT like HBASE-21740? I will resubmit the patch to trigger check!

 

Thanks!

> similar to HBASE-21740: NPE happens while shutdown the RS
> ---------------------------------------------------------
>
>                 Key: HBASE-22023
>                 URL: https://issues.apache.org/jira/browse/HBASE-22023
>             Project: HBase
>          Issue Type: Bug
>            Reporter: lujie
>            Assignee: lujie
>            Priority: Major
>         Attachments: 0001-fix-HBASE-22023-on-branch-1.4.patch, 
> 0001-fix-HBASE-22023-on-branch-2.2.patch, 
> 0001-fix-HBASE-22023-on-master.patch, HBASE-22023_1.patch, 
> HBASE-22023_branch_1.4_1.patch, HBASE-22023_branch_2.2_1.patch, 
> HBASE-22023_branch_2.2_2.patch
>
>
> shutdown command comes before startServices:
> {code:java}
> if (!isStopped() && !isAborted()) {
>   initializeThreads();
> }{code}
> so initializeThreads will skip and leases is null
> leases will be used in line 1996 without check, hence NPE happens
> Give the simple fix!
> {code:java}
> 2019-03-10 14:17:12,690 ERROR [regionserver/hadoop15:16020] 
> regionserver.HRegionServer: Failed init
> java.lang.NullPointerException
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.startServices(HRegionServer.java:1996)
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.handleReportForDutyResponse(HRegionServer.java:1575)
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:976)
> at java.lang.Thread.run(Thread.java:745)
> 2019-03-10 14:17:12,719 ERROR [regionserver/hadoop15:16020] 
> regionserver.HRegionServer: ***** ABORTING region server 
> hadoop15,16020,1552198622594: Unhandled: Region server startup failed *****
> java.io.IOException: Region server startup failed
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.convertThrowableToIOE(HRegionServer.java:3398)
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.handleReportForDutyResponse(HRegionServer.java:1594)
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:976)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.startServices(HRegionServer.java:1996)
> at 
> org.apache.hadoop.hbase.regionserver.HRegionServer.handleReportForDutyResponse(HRegionServer.java:1575)
> ... 2 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to