You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2013/01/18 17:05:16 UTC

[1/3] git commit: Fix range merging to avoid creating wrapping ones

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/trunk
Commit: 19972bdd91d6f8117eb8baa957b547000e995de3
Parents: 9717002
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Fri Jan 18 15:19:04 2013 +0100
Committer: Sylvain Lebresne <sy...@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.