Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 053AD113BB for ; Fri, 5 Sep 2014 15:30:30 +0000 (UTC) Received: (qmail 75290 invoked by uid 500); 5 Sep 2014 15:30:29 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 75237 invoked by uid 500); 5 Sep 2014 15:30:29 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 75224 invoked by uid 99); 5 Sep 2014 15:30:29 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2014 15:30:29 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6E4B7A0A555; Fri, 5 Sep 2014 15:30:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yukim@apache.org To: commits@cassandra.apache.org Date: Fri, 05 Sep 2014 15:30:30 -0000 Message-Id: <2f5b28a97c61461fbf2f8bd654c7a6ce@git.apache.org> In-Reply-To: <8491e1a4fce244d58c85dfd21bec3f35@git.apache.org> References: <8491e1a4fce244d58c85dfd21bec3f35@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/12] git commit: Make repair no-op when RF=1 Make repair no-op when RF=1 patch by yukim; reviewed by krummas for CASSANDRA-7864 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/46ef9628 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/46ef9628 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/46ef9628 Branch: refs/heads/cassandra-2.1.0 Commit: 46ef9628fa4035c26d81c4a070ebd270e59e5520 Parents: 77b036a Author: Yuki Morishita Authored: Fri Sep 5 10:22:33 2014 -0500 Committer: Yuki Morishita Committed: Fri Sep 5 10:22:33 2014 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/service/StorageService.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/46ef9628/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 7be8979..54fcc4f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ (CASSANDRA-7722) * Always send Paxos commit to all replicas (CASSANDRA-7479) * Make disruptor_thrift_server invocation pool configurable (CASSANDRA-7594) + * Make repair no-op when RF=1 (CASSANDRA-7864) 2.0.10 http://git-wip-us.apache.org/repos/asf/cassandra/blob/46ef9628/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index f16e187..12d6420 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -2404,7 +2404,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE public int forceRepairAsync(final String keyspace, final boolean isSequential, final Collection dataCenters, final Collection hosts, final Collection> ranges, final String... columnFamilies) { - if (Keyspace.SYSTEM_KS.equals(keyspace) || ranges.isEmpty()) + if (ranges.isEmpty() || Keyspace.open(keyspace).getReplicationStrategy().getReplicationFactor() < 2) return 0; final int cmd = nextRepairCommand.incrementAndGet(); @@ -2428,7 +2428,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE public int forceRepairAsync(String keyspace, boolean isSequential, boolean isLocal, Collection> ranges, String... columnFamilies) { - if (Keyspace.SYSTEM_KS.equals(keyspace) || ranges.isEmpty()) + if (ranges.isEmpty() || Keyspace.open(keyspace).getReplicationStrategy().getReplicationFactor() < 2) return 0; final int cmd = nextRepairCommand.incrementAndGet(); @@ -2497,7 +2497,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE public void forceKeyspaceRepairRange(final String keyspaceName, final Collection> ranges, boolean isSequential, boolean isLocal, final String... columnFamilies) throws IOException { - if (Keyspace.SYSTEM_KS.equalsIgnoreCase(keyspaceName)) + if (ranges.isEmpty() || Keyspace.open(keyspaceName).getReplicationStrategy().getReplicationFactor() < 2) return; createRepairTask(nextRepairCommand.incrementAndGet(), keyspaceName, ranges, isSequential, isLocal, columnFamilies).run(); }