@Test public void testRemoveStaleRecoveringRegionsDuringMasterInitialization() throws Exception { if (!UTIL.getConfiguration().getBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false)) return; LOG.info("Starting testRemoveStaleRecoveringRegionsDuringMasterInitialization"); HMaster master = UTIL.getMiniHBaseCluster().getMaster(); MasterFileSystem fs = master.getMasterFileSystem(); String failedRegion = "failedRegoin1"; String staleRegion = "staleRegion"; ServerName inRecoveryServerName = ServerName.valueOf("mgr,1,1"); ServerName previouselyFaildServerName = ServerName.valueOf("previous,1,1"); String walPath = "/hbase/data/.logs/" + inRecoveryServerName.getServerName() + "-splitting/test"; ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL); zkw.getRecoverableZooKeeper().create(ZKSplitLog.getEncodedNodeName(zkw, walPath), new SplitLogTask.Owned(inRecoveryServerName).toByteArray(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); String staleRegionPath = ZKUtil.joinZNode(zkw.recoveringRegionsZNode, staleRegion); ZKUtil.createWithParents(zkw, staleRegionPath); String inRecoveringRegionPath = ZKUtil.joinZNode(zkw.recoveringRegionsZNode, failedRegion); inRecoveringRegionPath = ZKUtil.joinZNode(inRecoveringRegionPath, inRecoveryServerName.getServerName()); ZKUtil.createWithParents(zkw, inRecoveringRegionPath); Set<ServerName> servers = new HashSet<ServerName>(); servers.add(previouselyFaildServerName); fs.removeStaleRecoveringRegionsFromZK(servers); assertFalse(ZKUtil.checkExists(zkw, staleRegionPath) != -1); assertTrue(ZKUtil.checkExists(zkw, inRecoveringRegionPath) != -1); ZKUtil.deleteChildrenRecursively(zkw, zkw.recoveringRegionsZNode); ZKUtil.deleteChildrenRecursively(zkw, zkw.splitLogZNode); zkw.close(); }
void removeStaleRecoveringRegionsFromZK(final Set<ServerName> failedServers) throws KeeperException, InterruptedIOException { this.splitLogManager.removeStaleRecoveringRegionsFromZK(failedServers); }
MasterFileSystem { void removeStaleRecoveringRegionsFromZK(final Set<ServerName> failedServers) throws KeeperException, InterruptedIOException { this.splitLogManager.removeStaleRecoveringRegionsFromZK(failedServers); } }
MasterFileSystem { void removeStaleRecoveringRegionsFromZK(final Set<ServerName> failedServers) throws KeeperException, InterruptedIOException { this.splitLogManager.removeStaleRecoveringRegionsFromZK(failedServers); } MasterFileSystem(Server master, MasterServices services); }
MasterFileSystem { void removeStaleRecoveringRegionsFromZK(final Set<ServerName> failedServers) throws KeeperException, InterruptedIOException { this.splitLogManager.removeStaleRecoveringRegionsFromZK(failedServers); } MasterFileSystem(Server master, MasterServices services); FileSystem getFileSystem(); Path getOldLogDir(); boolean checkFileSystem(); Path getRootDir(); Path getTempDir(); ClusterId getClusterId(); void splitLog(final ServerName serverName); void splitMetaLog(final ServerName serverName); void splitMetaLog(final Set<ServerName> serverNames); void prepareLogReplay(Set<ServerName> serverNames); void prepareLogReplay(ServerName serverName, Set<HRegionInfo> regions); void splitLog(final Set<ServerName> serverNames); void splitLog(final Set<ServerName> serverNames, PathFilter filter); static void setInfoFamilyCachingForMeta(final boolean b); void deleteRegion(HRegionInfo region); void deleteTable(TableName tableName); Path moveTableToTemp(TableName tableName); void updateRegionInfo(HRegionInfo region); void deleteFamilyFromFS(HRegionInfo region, byte[] familyName); void stop(); HTableDescriptor deleteColumn(TableName tableName, byte[] familyName); HTableDescriptor modifyColumn(TableName tableName, HColumnDescriptor hcd); HTableDescriptor addColumn(TableName tableName, HColumnDescriptor hcd); }
MasterFileSystem { void removeStaleRecoveringRegionsFromZK(final Set<ServerName> failedServers) throws KeeperException, InterruptedIOException { this.splitLogManager.removeStaleRecoveringRegionsFromZK(failedServers); } MasterFileSystem(Server master, MasterServices services); FileSystem getFileSystem(); Path getOldLogDir(); boolean checkFileSystem(); Path getRootDir(); Path getTempDir(); ClusterId getClusterId(); void splitLog(final ServerName serverName); void splitMetaLog(final ServerName serverName); void splitMetaLog(final Set<ServerName> serverNames); void prepareLogReplay(Set<ServerName> serverNames); void prepareLogReplay(ServerName serverName, Set<HRegionInfo> regions); void splitLog(final Set<ServerName> serverNames); void splitLog(final Set<ServerName> serverNames, PathFilter filter); static void setInfoFamilyCachingForMeta(final boolean b); void deleteRegion(HRegionInfo region); void deleteTable(TableName tableName); Path moveTableToTemp(TableName tableName); void updateRegionInfo(HRegionInfo region); void deleteFamilyFromFS(HRegionInfo region, byte[] familyName); void stop(); HTableDescriptor deleteColumn(TableName tableName, byte[] familyName); HTableDescriptor modifyColumn(TableName tableName, HColumnDescriptor hcd); HTableDescriptor addColumn(TableName tableName, HColumnDescriptor hcd);  }