bharathv commented on a change in pull request #1141: HBASE-23808 [Flakey Test] 
TestMasterShutdown#testMasterShutdownBefore…
URL: https://github.com/apache/hbase/pull/1141#discussion_r378018435
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
 ##########
 @@ -2804,9 +2804,15 @@ public MemoryBoundedLogMessageBuffer 
getRegionServerFatalLogBuffer() {
    * Master runs a coordinated stop of all RegionServers and then itself.
    */
   public void shutdown() throws IOException {
+    if (!isInitialized()) {
+      LOG.info("Shutdown requested but we're not the active master. Proceeding 
as a stop.");
 
 Review comment:
   Well, I'm not entirely sure if this is the intended way to stop stand-by 
masters. Reading the code.. it looks like the active master coordinates a 
proper cluster shutdown. In that process, it removes the /hbase/running znode 
that the standb-bys keep a watch on. See the following code in 
ActiveMasterManager..
   
   ```
   @Override
     public void nodeDeleted(String path) {
   
       // We need to keep track of the cluster's shutdown status while
       // we wait on the current master. We consider that, if the cluster
       // was already in a "shutdown" state when we started, that this master
       // is part of a new cluster that was started shortly after the old 
cluster
       // shut down, so that state is now irrelevant. This means that the 
shutdown
       // state must be set while we wait on the active master in order
       // to shutdown this master. See HBASE-8519.
       if(path.equals(watcher.getZNodePaths().clusterStateZNode) && 
!master.isStopped()) {
         clusterShutDown.set(true);
       }
   
   ```
   Ideally they should shut themselves down if the ZK event notifications 
happen as expected. Is that not the case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to