Author: jbellis
Date: Tue Feb 22 17:32:27 2011
New Revision: 1073427

URL: http://svn.apache.org/viewvc?rev=1073427&view=rev
Log:
fix compaction echoing old-style data into new sstable version
patch by slebresne; reviewed by jbellis for CASSANDRA-2216

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/LazilyCompactedRow.java
    
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/PrecompactedRow.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1073427&r1=1073426&r2=1073427&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Tue Feb 22 17:32:27 2011
@@ -10,10 +10,11 @@
  * refactor stress.py to have only one copy of the format string 
    used for creating row keys (CASSANDRA-2108)
  * validate index names for \w+ (CASSANDRA-2196)
- * Fix Cassandra cli to respect timeout if schema does not settle 
(CASSANDRA-2187)
+ * Fix Cassandra cli to respect timeout if schema does not settle 
+   (CASSANDRA-2187)
  * update memtable_throughput to be a long (CASSANDRA-2158)
- * fix for cleanup writing old-format data into new-version sstable 
-   (CASSANRDRA-2211)
+ * fix for compaction and cleanup writing old-format data into new-version 
+   sstable (CASSANDRA-2211, -2216)
 
 
 0.7.2

Modified: 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/LazilyCompactedRow.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/LazilyCompactedRow.java?rev=1073427&r1=1073426&r2=1073427&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/LazilyCompactedRow.java
 (original)
+++ 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/LazilyCompactedRow.java
 Tue Feb 22 17:32:27 2011
@@ -94,7 +94,7 @@ public class LazilyCompactedRow extends 
 
     public void write(DataOutput out) throws IOException
     {
-        if (rows.size() == 1 && !shouldPurge)
+        if (rows.size() == 1 && !shouldPurge && 
rows.get(0).sstable.descriptor.isLatestVersion)
         {
             SSTableIdentityIterator row = rows.get(0);
             out.writeLong(row.dataSize);

Modified: 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/PrecompactedRow.java
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/PrecompactedRow.java?rev=1073427&r1=1073426&r2=1073427&view=diff
==============================================================================
--- 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/PrecompactedRow.java
 (original)
+++ 
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/PrecompactedRow.java
 Tue Feb 22 17:32:27 2011
@@ -67,7 +67,7 @@ public class PrecompactedRow extends Abs
         }
         boolean shouldPurge = major || !cfStore.isKeyInRemainingSSTables(key, 
sstables);
 
-        if (rows.size() > 1 || shouldPurge)
+        if (rows.size() > 1 || shouldPurge || 
!rows.get(0).sstable.descriptor.isLatestVersion)
         {
             ColumnFamily cf = null;
             for (SSTableIdentityIterator row : rows)


Reply via email to