cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1140550 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java src/java/org/apache/cassandra/service/RowRepairResolver.java
Date Tue, 28 Jun 2011 12:12:15 GMT
Author: slebresne
Date: Tue Jun 28 12:12:15 2011
New Revision: 1140550

URL: http://svn.apache.org/viewvc?rev=1140550&view=rev
Log:
Fix potential NPE during read repair
patch by slebresne; reviewed by jbellis for CASSANDRA-2823

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RowRepairResolver.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1140550&r1=1140549&r2=1140550&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Tue Jun 28 12:12:15 2011
@@ -22,6 +22,7 @@
    (CASSANDRA-2766, CASSANDRA-2792)
  * Expose number of threads blocked on submitting memtable to flush
    (CASSANDRA-2817)
+ * Fix potential NPE during read repair (CASSANDRA-2823)
 
 
 0.7.6

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java?rev=1140550&r1=1140549&r2=1140550&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RangeSliceResponseResolver.java
Tue Jun 28 12:12:15 2011
@@ -117,7 +117,9 @@ public class RangeSliceResponseResolver 
                         }
                     }
                 }
-                RowRepairResolver.maybeScheduleRepairs(resolved, table, key, versions, versionSources);
+                // resolved can be null even if versions doesn't have all nulls because of
the call to removeDeleted in resolveSuperSet
+                if (resolved != null)
+                    RowRepairResolver.maybeScheduleRepairs(resolved, table, key, versions,
versionSources);
                 versions.clear();
                 versionSources.clear();
                 return new Row(key, resolved);

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RowRepairResolver.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RowRepairResolver.java?rev=1140550&r1=1140549&r2=1140550&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RowRepairResolver.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/RowRepairResolver.java
Tue Jun 28 12:12:15 2011
@@ -78,7 +78,9 @@ public class RowRepairResolver extends A
             resolved = resolveSuperset(versions);
             if (logger.isDebugEnabled())
                 logger.debug("versions merged");
-            maybeScheduleRepairs(resolved, table, key, versions, endpoints);
+            // resolved can be null even if versions doesn't have all nulls because of the
call to removeDeleted in resolveSuperSet
+            if (resolved != null)
+                maybeScheduleRepairs(resolved, table, key, versions, endpoints);
         }
         else
         {



Mime
View raw message