TableServers.isMasterRunning() skips checking master status if master field is 
not null
---------------------------------------------------------------------------------------

                 Key: HBASE-2391
                 URL: https://issues.apache.org/jira/browse/HBASE-2391
             Project: Hadoop HBase
          Issue Type: Bug
          Components: client
    Affects Versions: 0.20.3
         Environment: CentOS
            Reporter: Ted Yu


We call HBaseAdmin.isMasterRunning()  to see if client has connection with 
HBase.

While going over TableServers.isMasterRunning() in HConnectionManager, I see 
this:
    public boolean isMasterRunning() {
      if (this.master == null) {
        try {
          getMaster();
         
        } catch (MasterNotRunningException e) {
          return false;
        }
      }
      return true;
    }
When isMasterRunning() is called the first time, if master is obtained 
successfully, master field would contain reference to HMasterInterface. 
Subsequent calls to isMasterRunning() wouldn't throw MasterNotRunningException 
even if master server stops responding to clients.

I think master.isMasterRunning() should be called if master isn't null.

J-D pointed out that:
I think this method wasn't updated when we moved to Zookeeper (since
in pre-0.20, dead master = dead cluster), also looking at when this is
called, I only see it from HMerge and HBaseAdmin.isMasterRunning()...
which in turn isn't called anywhere in the java code (I think we call
it in the shell tho).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to