cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1135426 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Date Tue, 14 Jun 2011 09:17:00 GMT
Author: slebresne
Date: Tue Jun 14 09:17:00 2011
New Revision: 1135426

URL: http://svn.apache.org/viewvc?rev=1135426&view=rev
Log:
Don't skip rows in scub for counter column families
patch by slebresne; reviewed by jbellis for CASSANDRA-2759

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1135426&r1=1135425&r2=1135426&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Tue Jun 14 09:17:00 2011
@@ -52,6 +52,7 @@
  * avoid marking entire list of sstables as actively being compacted
    in multithreaded compaction (CASSANDRA-2765)
  * seek back after deserializing a row to update cache with (CASSANDRA-2752)
+ * avoid skipping rows in scrub for counter column family (CASSANDRA-2759)
 
 
 0.8.0-final

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java?rev=1135426&r1=1135425&r2=1135426&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
Tue Jun 14 09:17:00 2011
@@ -637,6 +637,7 @@ public class CompactionManager implement
     {
         logger.info("Scrubbing " + sstable);
         CompactionController controller = new CompactionController(cfs, Collections.singletonList(sstable),
getDefaultGcBefore(cfs), true);
+        boolean isCommutative = cfs.metadata.getDefaultValidator().isCommutative();
 
         // Calculate the expected compacted filesize
         String compactionFileLocation = cfs.table.getDataFileLocation(sstable.length());
@@ -759,6 +760,10 @@ public class CompactionManager implement
                         catch (Throwable th2)
                         {
                             throwIfFatal(th2);
+                            // Skipping rows is dangerous for counters (see CASSANDRA-2759)
+                            if (isCommutative)
+                                throw new IOError(th2);
+
                             logger.warn("Retry failed too.  Skipping to next row (retry's
stacktrace follows)", th2);
                             writer.reset();
                             dataFile.seek(nextRowPositionFromIndex);
@@ -767,6 +772,10 @@ public class CompactionManager implement
                     }
                     else
                     {
+                        // Skipping rows is dangerous for counters (see CASSANDRA-2759)
+                        if (isCommutative)
+                            throw new IOError(th);
+
                         logger.warn("Row at " + dataStart + " is unreadable; skipping to
next");
                         if (currentIndexKey != null)
                             dataFile.seek(nextRowPositionFromIndex);



Mime
View raw message