HBASE-3747 ReplicationSource should differanciate remote and local exceptions

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1089701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2011-04-07 01:00:34 +00:00
parent 9e6f97fd61
commit bea0012d5d
2 changed files with 15 additions and 5 deletions

View File

@ -178,6 +178,10 @@ Release 0.90.3 - Unreleased
DistributedFileSystem (todd)
IMPROVEMENTS
HBASE-3747 ReplicationSource should differanciate remote and local exceptions
Release 0.90.2 - Unreleased
BUG FIXES

View File

@ -54,6 +54,7 @@ import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
import org.apache.hadoop.hbase.replication.ReplicationZookeeper;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.zookeeper.KeeperException;
/**
@ -568,16 +569,18 @@ public class ReplicationSource extends Thread
break;
} catch (IOException ioe) {
LOG.warn("Unable to replicate because ", ioe);
if (ioe instanceof RemoteException) {
ioe = ((RemoteException) ioe).unwrapRemoteException();
LOG.warn("Can't replicate because of an error on the remote cluster: ", ioe);
} else {
LOG.warn("Can't replicate because of a local or network error: ", ioe);
}
try {
boolean down;
do {
down = isSlaveDown();
if (down) {
LOG.debug("The region server we tried to ping didn't answer, " +
"sleeping " + sleepForRetries + " times " + sleepMultiplier);
Thread.sleep(this.sleepForRetries * sleepMultiplier);
if (sleepMultiplier < maxRetriesMultiplier) {
if (sleepForRetries("Since we are unable to replicate", sleepMultiplier)) {
sleepMultiplier++;
} else {
chooseSinks();
@ -673,6 +676,9 @@ public class ReplicationSource extends Thread
rrs.getHServerInfo();
latch.countDown();
} catch (IOException ex) {
if (ex instanceof RemoteException) {
ex = ((RemoteException) ex).unwrapRemoteException();
}
LOG.info("Slave cluster looks down: " + ex.getMessage());
}
}