You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2015/10/14 17:56:27 UTC
cassandra git commit: Stronger assertion on null hostId in
SP::writeHintForMutation
Repository: cassandra
Updated Branches:
refs/heads/cassandra-2.1 3c0a1a5c1 -> bc1058f8e
Stronger assertion on null hostId in SP::writeHintForMutation
patch by J.P.Eiti Kimura; reviewed by Paulo Motta for CASSANDRA-10233
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/bc1058f8
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/bc1058f8
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/bc1058f8
Branch: refs/heads/cassandra-2.1
Commit: bc1058f8ea1e50d57db6e06fb027845871d9927c
Parents: 3c0a1a5
Author: J.P.Eiti Kimura <ei...@movile.com>
Authored: Wed Oct 7 23:19:36 2015 -0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Oct 14 16:53:50 2015 +0100
----------------------------------------------------------------------
src/java/org/apache/cassandra/service/StorageProxy.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/bc1058f8/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 161bec8..f8b4f1c 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -984,7 +984,11 @@ public class StorageProxy implements StorageProxyMBean
{
assert ttl > 0;
UUID hostId = StorageService.instance.getTokenMetadata().getHostId(target);
- assert hostId != null : "Missing host ID for " + target.getHostAddress();
+ if (hostId == null)
+ {
+ logger.warn("Missing host Id for {}", target.getHostAddress());
+ throw new AssertionError("Missing host Id for " + target.getHostAddress());
+ }
HintedHandOffManager.instance.hintFor(mutation, now, ttl, hostId).apply();
StorageMetrics.totalHints.inc();
}