Updated Branches:
  refs/heads/trunk 669025cf2 -> bd32d4f0b

StorageProxy throws NPEs for when there's no hostids for a target
patch by dbrosius reviewed by jbellis for CASSANDRA-4227


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

Branch: refs/heads/trunk
Commit: bd32d4f0b9f0f88fed97e8ddf2ee41b5b048d31d
Parents: 669025c
Author: Dave Brosius <[email protected]>
Authored: Tue May 22 19:50:32 2012 -0400
Committer: Dave Brosius <[email protected]>
Committed: Tue May 22 19:50:32 2012 -0400

----------------------------------------------------------------------
 .../org/apache/cassandra/service/StorageProxy.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd32d4f0/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 9fad95a..10189a0 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -362,8 +362,11 @@ public class StorageProxy implements StorageProxyMBean
                 try
                 {
                     UUID hostId = 
StorageService.instance.getTokenMetadata().getHostId(target);
-                    if ((hostId == null) && 
(Gossiper.instance.getVersion(target) < MessagingService.VERSION_12))
-                        logger.info("Unable to store hint for host with 
missing ID, {} (old node?)", target.toString());
+                    if (hostId == null) // The node in question will not have 
a host id if older than MessagingService.VERSION_12 in a mixed version cluster
+                    {
+                        logger.warn("Unable to store hint for host with 
missing ID, {} (old node?)", target.toString());
+                        return;
+                    }
                     RowMutation hintedMutation = RowMutation.hintFor(mutation, 
ByteBuffer.wrap(UUIDGen.decompose(hostId)));
                     hintedMutation.apply();
 

Reply via email to