HBASE-3128 On assign, if ConnectException, reassign another server
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1024524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a7d61ec5b5
commit
6d2aaf8833
|
@ -1018,6 +1018,7 @@ Release 0.21.0 - Unreleased
|
|||
HBASE-3115 HBaseClient wastes 1 TCP packet per RPC
|
||||
HBASE-3076 Allow to disable automatic shipping of dependency jars
|
||||
for mapreduce jobs (Bruno Dumon)
|
||||
HBASE-3128 On assign, if ConnectException, reassign another server
|
||||
|
||||
NEW FEATURES
|
||||
HBASE-1961 HBase EC2 scripts
|
||||
|
|
|
@ -729,7 +729,7 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
} catch (Throwable t) {
|
||||
LOG.warn("Failed assignment of " +
|
||||
state.getRegion().getRegionNameAsString() + " to " +
|
||||
plan.getDestination(), t);
|
||||
plan.getDestination() + ", trying to assign elsewhere instead", t);
|
||||
// Clean out plan we failed execute and one that doesn't look like it'll
|
||||
// succeed anyways; we need a new plan!
|
||||
this.regionPlans.remove(state.getRegion().getEncodedName());
|
||||
|
@ -873,18 +873,11 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
try {
|
||||
serverManager.sendRegionClose(regions.get(region), state.getRegion());
|
||||
} catch (IOException e) {
|
||||
if (e instanceof RemoteException) {
|
||||
e = ((RemoteException)e).unwrapRemoteException();
|
||||
}
|
||||
if (e instanceof NotServingRegionException) {
|
||||
LOG.warn("Attempted to close region " + region.getRegionNameAsString() +
|
||||
" but got an NSRE", e);
|
||||
}
|
||||
// For now call abort if unexpected exception -- seeing it up in hudson.
|
||||
// For now call abort if unexpected exception -- radical, but will get fellas attention.
|
||||
// St.Ack 20101012
|
||||
this.master.abort("Remote unexpected exception", e);
|
||||
} catch (Throwable t) {
|
||||
// For now call abort if unexpected exception -- seeing it up in hudson.
|
||||
// For now call abort if unexpected exception -- radical, but will get fellas attention.
|
||||
// St.Ack 20101012
|
||||
this.master.abort("Unexpected exception", t);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.PleaseHoldException;
|
|||
import org.apache.hadoop.hbase.Server;
|
||||
import org.apache.hadoop.hbase.Stoppable;
|
||||
import org.apache.hadoop.hbase.YouAreDeadException;
|
||||
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
|
||||
import org.apache.hadoop.hbase.client.HConnection;
|
||||
import org.apache.hadoop.hbase.client.HConnectionManager;
|
||||
import org.apache.hadoop.hbase.ipc.HRegionInterface;
|
||||
|
@ -48,7 +49,6 @@ import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
|
|||
import org.apache.hadoop.hbase.master.metrics.MasterMetrics;
|
||||
import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException;
|
||||
import org.apache.hadoop.hbase.util.Threads;
|
||||
import org.apache.hadoop.ipc.RemoteException;
|
||||
import org.apache.hadoop.util.StringUtils;
|
||||
|
||||
/**
|
||||
|
@ -558,21 +558,24 @@ public class ServerManager {
|
|||
hri.closeRegion(region);
|
||||
}
|
||||
|
||||
private HRegionInterface getServerConnection(HServerInfo info) {
|
||||
try {
|
||||
HConnection connection =
|
||||
HConnectionManager.getConnection(this.master.getConfiguration());
|
||||
HRegionInterface hri = serverConnections.get(info.getServerName());
|
||||
if (hri == null) {
|
||||
LOG.debug("New connection to " + info.getServerName());
|
||||
hri = connection.getHRegionConnection(info.getServerAddress(), false);
|
||||
serverConnections.put(info.getServerName(), hri);
|
||||
}
|
||||
return hri;
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error connecting to region server", e);
|
||||
throw new RuntimeException("Fatal error connection to RS", e);
|
||||
/**
|
||||
* @param info
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws RetriesExhaustedException wrapping a ConnectException if failed
|
||||
* putting up proxy.
|
||||
*/
|
||||
private HRegionInterface getServerConnection(HServerInfo info)
|
||||
throws IOException {
|
||||
HConnection connection =
|
||||
HConnectionManager.getConnection(this.master.getConfiguration());
|
||||
HRegionInterface hri = serverConnections.get(info.getServerName());
|
||||
if (hri == null) {
|
||||
LOG.debug("New connection to " + info.getServerName());
|
||||
hri = connection.getHRegionConnection(info.getServerAddress(), false);
|
||||
this.serverConnections.put(info.getServerName(), hri);
|
||||
}
|
||||
return hri;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue