cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Fix range merging to avoid creating wrapping ones
Date Fri, 18 Jan 2013 14:19:11 GMT
Updated Branches:
  refs/heads/cassandra-1.2 971700249 -> 19972bdd9


Fix range merging to avoid creating wrapping ones


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/19972bdd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/19972bdd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/19972bdd

Branch: refs/heads/cassandra-1.2
Commit: 19972bdd91d6f8117eb8baa957b547000e995de3
Parents: 9717002
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jan 18 15:19:04 2013 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jan 18 15:19:04 2013 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/service/StorageProxy.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/19972bdd/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index b541332..c234bd1 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -1146,6 +1146,16 @@ public class StorageProxy implements StorageProxyMBean
                     nextEndpoints = getLiveSortedEndpoints(table, nextRange.right);
                     nextFilteredEndpoints = consistency_level.filterForQuery(table, nextEndpoints);
 
+                    /*
+                     * If the current range right is the min token, we should stop merging
because CFS.getRangeSlice
+                     * don't know how to deal with a wrapping range.
+                     * Note: it would be slightly more efficient to have CFS.getRangeSlice
on the destination nodes unwraps
+                     * the range if necessary and deal with it. However, we can't start sending
wrapped range without breaking
+                     * wire compatibility, so It's likely easier not to bother;
+                     */
+                    if (range.right.isMinimum())
+                        break;
+
                     List<InetAddress> merged = intersection(liveEndpoints, nextEndpoints);
 
                     // Check if there is enough endpoint for the merge to be possible.


Mime
View raw message