cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject cassandra git commit: Include ks name in failed streaming error message
Date Tue, 11 Nov 2014 17:38:43 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 c3a809584 -> a6802aa47


Include ks name in failed streaming error message

Patch by Rajanarayanan Thottuvaikkatumana; reviewed by Tyler Hobbs for
CASSANDRA-8221


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

Branch: refs/heads/cassandra-2.0
Commit: a6802aa479a46b6f3fb1855786f72f6e3b08e0b9
Parents: c3a8095
Author: Rajanarayanan Thottuvaikkatumana <rnamboodiri@gmail.com>
Authored: Tue Nov 11 11:38:06 2014 -0600
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Tue Nov 11 11:38:06 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 src/java/org/apache/cassandra/dht/RangeStreamer.java      | 10 +++++-----
 src/java/org/apache/cassandra/service/StorageService.java |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6802aa4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2b3bd3c..842643c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Include keyspace name in error message when there are insufficient
+   live nodes to stream from (CASSANDRA-8221)
  * Avoid overlap in L1 when L0 contains many nonoverlapping
    sstables (CASSANDRA-8211)
  * Improve PropertyFileSnitch logging (CASSANDRA-8183)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6802aa4/src/java/org/apache/cassandra/dht/RangeStreamer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/RangeStreamer.java b/src/java/org/apache/cassandra/dht/RangeStreamer.java
index 4e925d3..8846e1d 100644
--- a/src/java/org/apache/cassandra/dht/RangeStreamer.java
+++ b/src/java/org/apache/cassandra/dht/RangeStreamer.java
@@ -123,7 +123,7 @@ public class RangeStreamer
                 logger.debug(String.format("%s: range %s exists on %s", description, entry.getKey(),
entry.getValue()));
         }
 
-        for (Map.Entry<InetAddress, Collection<Range<Token>>> entry : getRangeFetchMap(rangesForKeyspace,
sourceFilters).asMap().entrySet())
+        for (Map.Entry<InetAddress, Collection<Range<Token>>> entry : getRangeFetchMap(rangesForKeyspace,
sourceFilters, keyspaceName).asMap().entrySet())
         {
             if (logger.isDebugEnabled())
             {
@@ -170,7 +170,7 @@ public class RangeStreamer
      * @return
      */
     private static Multimap<InetAddress, Range<Token>> getRangeFetchMap(Multimap<Range<Token>,
InetAddress> rangesWithSources,
-                                                                        Collection<ISourceFilter>
sourceFilters)
+                                                                        Collection<ISourceFilter>
sourceFilters, String keyspace)
     {
         Multimap<InetAddress, Range<Token>> rangeFetchMapMap = HashMultimap.create();
         for (Range<Token> range : rangesWithSources.keySet())
@@ -199,15 +199,15 @@ public class RangeStreamer
             }
 
             if (!foundSource)
-                throw new IllegalStateException("unable to find sufficient sources for streaming
range " + range);
+                throw new IllegalStateException("unable to find sufficient sources for streaming
range " + range + " in keyspace " + keyspace);
         }
 
         return rangeFetchMapMap;
     }
 
-    public static Multimap<InetAddress, Range<Token>> getWorkMap(Multimap<Range<Token>,
InetAddress> rangesWithSourceTarget)
+    public static Multimap<InetAddress, Range<Token>> getWorkMap(Multimap<Range<Token>,
InetAddress> rangesWithSourceTarget, String keyspace)
     {
-        return getRangeFetchMap(rangesWithSourceTarget, Collections.<ISourceFilter>singleton(new
FailureDetectorSourceFilter(FailureDetector.instance)));
+        return getRangeFetchMap(rangesWithSourceTarget, Collections.<ISourceFilter>singleton(new
FailureDetectorSourceFilter(FailureDetector.instance)), keyspace);
     }
 
     // For testing purposes

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6802aa4/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 066544a..4bc1eee 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3200,7 +3200,7 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
                     }
 
                     // stream requests
-                    Multimap<InetAddress, Range<Token>> workMap = RangeStreamer.getWorkMap(rangesToFetchWithPreferredEndpoints);
+                    Multimap<InetAddress, Range<Token>> workMap = RangeStreamer.getWorkMap(rangesToFetchWithPreferredEndpoints,
keyspace);
                     for (InetAddress address : workMap.keySet())
                     {
                         InetAddress preferred = SystemKeyspace.getPreferredIP(address);


Mime
View raw message