Return-Path: Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: (qmail 42260 invoked from network); 14 Oct 2010 23:53:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Oct 2010 23:53:46 -0000 Received: (qmail 36762 invoked by uid 500); 14 Oct 2010 23:53:46 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 36725 invoked by uid 500); 14 Oct 2010 23:53:46 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 36718 invoked by uid 99); 14 Oct 2010 23:53:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Oct 2010 23:53:46 +0000 X-ASF-Spam-Status: No, hits=-1996.4 required=10.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Oct 2010 23:53:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ADE482388993; Thu, 14 Oct 2010 23:52:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Thu, 14 Oct 2010 23:52:49 -0000 To: commits@hbase.apache.org From: jdcryans@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101014235249.ADE482388993@eris.apache.org> 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();