cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: Fix upgradesstables NPE for non-CF-based indexes patch by Sergio Bossa; reviewed by jbellis for CASSANDRA-6645
Date Thu, 06 Feb 2014 16:15:10 GMT
Updated Branches:
  refs/heads/cassandra-2.0 43e6e184b -> 45955e682
  refs/heads/trunk 3a82adb89 -> f97a981d5


Fix upgradesstables NPE for non-CF-based indexes
patch by Sergio Bossa; reviewed by jbellis for CASSANDRA-6645


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

Branch: refs/heads/cassandra-2.0
Commit: 45955e6829a765cb12671f628480e9c397cb695d
Parents: 43e6e18
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Feb 6 10:14:37 2014 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Feb 6 10:14:37 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../cassandra/db/index/SecondaryIndexSearcher.java      |  2 +-
 .../db/index/composites/CompositesSearcher.java         |  1 +
 .../apache/cassandra/db/index/keys/KeysSearcher.java    |  1 +
 .../org/apache/cassandra/service/StorageService.java    | 12 ++++++++----
 5 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/45955e68/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index dfbe5c6..b260b49 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.6
+ * Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
  * Improve nodetool cfhistograms formatting (CASSANDRA-6360)
  * Expose bulk loading progress over JMX (CASSANDRA-4757)
  * Correctly handle null with IF conditions and TTL (CASSANDRA-6623)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45955e68/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
index f3e993d..e93efd1 100644
--- a/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java
@@ -63,7 +63,7 @@ public abstract class SecondaryIndexSearcher
                 continue;
 
             SecondaryIndex index = indexManager.getIndexForColumn(expression.column_name);
-            if (index == null || (expression.op != IndexOperator.EQ))
+            if (index == null || index.getIndexCfs() == null || expression.op != IndexOperator.EQ)
                 continue;
             int columns = index.getIndexCfs().getMeanColumns();
             candidates.put(index, columns);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45955e68/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index aa35605..90e7089 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -80,6 +80,7 @@ public class CompositesSearcher extends SecondaryIndexSearcher
         final IndexExpression primary = highestSelectivityPredicate(filter.getClause());
         final CompositesIndex index = (CompositesIndex)indexManager.getIndexForColumn(primary.column_name);
         assert index != null;
+        assert index.getIndexCfs() != null;
         final DecoratedKey indexKey = index.getIndexKeyFor(primary.value);
 
         if (logger.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45955e68/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
index e14f865..5d82ba0 100644
--- a/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/keys/KeysSearcher.java
@@ -63,6 +63,7 @@ public class KeysSearcher extends SecondaryIndexSearcher
         final IndexExpression primary = highestSelectivityPredicate(filter.getClause());
         final SecondaryIndex index = indexManager.getIndexForColumn(primary.column_name);
         assert index != null;
+        assert index.getIndexCfs() != null;
         final DecoratedKey indexKey = index.getIndexKeyFor(primary.value);
 
         if (logger.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/45955e68/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 9a6b50f..26846e7 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2297,8 +2297,10 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                 {
                     for (SecondaryIndex si : cfStore.indexManager.getIndexes())
                     {
-                        logger.info("adding secondary index {} to operation", si.getIndexName());
-                        valid.add(si.getIndexCfs());
+                        if (si.getIndexCfs() != null) {
+                            logger.info("adding secondary index {} to operation", si.getIndexName());
+                            valid.add(si.getIndexCfs());
+                        }
                     }
 
                 }
@@ -2346,8 +2348,10 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                 {
                     for(SecondaryIndex si : cfStore.indexManager.getIndexes())
                     {
-                        logger.info("adding secondary index {} to operation", si.getIndexName());
-                        valid.add(si.getIndexCfs());
+                        if (si.getIndexCfs() != null) {
+                            logger.info("adding secondary index {} to operation", si.getIndexName());
+                            valid.add(si.getIndexCfs());
+                        }
                     }
                 }
             }


Mime
View raw message