mirror of https://github.com/apache/cassandra
Fix upgradesstables NPE for non-CF-based indexes
patch by Sergio Bossa; reviewed by jbellis for CASSANDRA-6645
This commit is contained in:
parent
adcb713d59
commit
8b6d87b86b
|
|
@ -1,6 +1,8 @@
|
|||
1.2.16
|
||||
* Fix upgradesstables NPE for non-CF-based indexes (CASSANDRA-6645)
|
||||
* Fix partition and range deletes not triggering flush (CASSANDRA-6655)
|
||||
|
||||
|
||||
1.2.15
|
||||
* Move handling of migration event source to solve bootstrap race (CASSANDRA-6648)
|
||||
* Make sure compaction throughput value doesn't overflow with int math (CASSANDRA-6647)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class CompositesSearcher extends 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);
|
||||
|
|
@ -106,6 +106,7 @@ public class CompositesSearcher 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())
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class KeysSearcher extends 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);
|
||||
|
|
@ -102,6 +102,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())
|
||||
|
|
|
|||
|
|
@ -2314,8 +2314,11 @@ 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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2364,8 +2367,11 @@ 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue