Author: jbellis
Date: Thu Oct 20 21:19:37 2011
New Revision: 1187053

URL: http://svn.apache.org/viewvc?rev=1187053&view=rev
Log:
tolerate index being dropped mid-mutation, part 2
patch by jbellis; reviewed by slebresne for CASSANDRA-3313

Modified:
    cassandra/branches/cassandra-1.0/CHANGES.txt
    
cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java

Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1187053&r1=1187052&r2=1187053&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Thu Oct 20 21:19:37 2011
@@ -45,7 +45,7 @@
  * avoid locking on update when no indexes are involved (CASSANDRA-3386)
  * optimize UUIDGen to avoid lock contention on InetAddress.getLocalHost 
    (CASSANDRA-3387)
- * tolerate index being dropped mid-mutation (CASSANDRA-3334)
+ * tolerate index being dropped mid-mutation (CASSANDRA-3334, 3313)
 
 
 1.0.0-final

Modified: 
cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java?rev=1187053&r1=1187052&r2=1187053&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
 (original)
+++ 
cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
 Thu Oct 20 21:19:37 2011
@@ -33,6 +33,7 @@ import org.apache.cassandra.io.sstable.R
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.thrift.IndexClause;
 import org.apache.cassandra.thrift.IndexExpression;
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -399,9 +400,13 @@ public class SecondaryIndexManager
                 continue; // null column == row deletion
 
             SecondaryIndex index = getIndexForColumn(columnName);
-            assert index != null;
+            if (index == null)
+            {
+                logger.debug("index on {} removed; skipping remove-old for 
{}", columnName, ByteBufferUtil.bytesToHex(rowKey));
+                continue;
+            }
 
-            //Update entire row if we encounter a row level index
+            // Update entire row if we encounter a row level index
             if (index instanceof PerRowSecondaryIndex)
             {
                 if (appliedRowLevelIndexes == null)


Reply via email to