You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2010/10/15 01:52:49 UTC
svn commit: r1022770 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Author: jdcryans
Date: Thu Oct 14 23:52:49 2010
New Revision: 1022770
URL: http://svn.apache.org/viewvc?rev=1022770&view=rev
Log:
HBASE-3041 [replication] ReplicationSink shouldn't kill the whole RS when
it fails to replicate
HBASE-3044 [replication] ReplicationSource won't cleanup logs if there's
nothing to replicate
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1022770&r1=1022769&r2=1022770&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Oct 14 23:52:49 2010
@@ -581,6 +581,10 @@ Release 0.21.0 - Unreleased
HBASE-3063 TestThriftServer failing in TRUNK
HBASE-3094 Fixes for miscellaneous broken tests
HBASE-3060 [replication] Reenable replication on trunk with unit tests
+ HBASE-3041 [replication] ReplicationSink shouldn't kill the whole RS when
+ it fails to replicate
+ HBASE-3044 [replication] ReplicationSource won't cleanup logs if there's
+ nothing to replicate
IMPROVEMENTS
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java?rev=1022770&r1=1022769&r2=1022770&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java Thu Oct 14 23:52:49 2010
@@ -146,21 +146,8 @@ public class ReplicationSink {
this.metrics.appliedBatchesRate.inc(1);
LOG.info("Total replicated: " + totalReplicated);
} catch (IOException ex) {
- if (ex.getCause() instanceof TableNotFoundException) {
- LOG.warn("Losing edits because: ", ex);
- } else {
- // Should we log rejected edits in a file for replay?
- LOG.error("Unable to accept edit because", ex);
- this.stopper.stop("Unable to accept edit because " + ex.getMessage());
- throw ex;
- }
- } catch (RuntimeException re) {
- if (re.getCause() instanceof TableNotFoundException) {
- LOG.warn("Losing edits because: ", re);
- } else {
- this.stopper.stop("Replication stopped us because " + re.getMessage());
- throw re;
- }
+ LOG.error("Unable to accept edit because:", ex);
+ throw ex;
}
}
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1022770&r1=1022769&r2=1022770&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Thu Oct 14 23:52:49 2010
@@ -320,6 +320,8 @@ public class ReplicationSource extends T
// wait a bit and retry.
// But if we need to stop, don't bother sleeping
if (!stopper.isStopped() && (gotIOE || currentNbEntries == 0)) {
+ this.manager.logPositionAndCleanOldLogs(this.currentPath,
+ this.peerClusterZnode, this.position, queueRecovered);
if (sleepForRetries("Nothing to replicate", sleepMultiplier)) {
sleepMultiplier++;
}
@@ -527,6 +529,10 @@ public class ReplicationSource extends T
*/
protected void shipEdits() {
int sleepMultiplier = 1;
+ if (this.currentNbEntries == 0) {
+ LOG.warn("Was given 0 edits to ship");
+ return;
+ }
while (!this.stopper.isStopped()) {
try {
HRegionInterface rrs = getRS();