cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [4/6] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Fri, 27 Mar 2015 18:37:38 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/89a8f4a7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/89a8f4a7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/89a8f4a7

Branch: refs/heads/trunk
Commit: 89a8f4a7e96b11a1ac13414cd4565a5b0b1f05f4
Parents: f7856c2 e2ad896
Author: Yuki Morishita <yukim@apache.org>
Authored: Fri Mar 27 13:35:29 2015 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Mar 27 13:35:29 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                      |  1 +
 .../db/compaction/LazilyCompactedRow.java        |  7 ++++++-
 .../org/apache/cassandra/repair/Validator.java   | 19 ++++++++++++++++---
 3 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/89a8f4a7/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 3f5571e,9494f61..64fa75f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -83,6 -23,10 +83,7 @@@ Merged from 2.0
   * Add ability to limit number of native connections (CASSANDRA-8086)
   * Fix CQLSSTableWriter throwing exception and spawning threads
     (CASSANDRA-8808)
+  * Fix MT mismatch between empty and GC-able data (CASSANDRA-8979)
 -
 -
 -2.0.13:
   * Add offline tool to relevel sstables (CASSANDRA-8301)
   * Preserve stream ID for more protocol errors (CASSANDRA-8848)
   * Fix combining token() function with multi-column relations on

http://git-wip-us.apache.org/repos/asf/cassandra/blob/89a8f4a7/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index f61225a,b562ba5..88c87a4
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@@ -159,7 -141,11 +159,12 @@@ public class LazilyCompactedRow extend
          try
          {
              DeletionTime.serializer.serialize(emptyColumnFamily.deletionInfo().getTopLevelDeletion(),
out);
-             digest.update(out.getData(), 0, out.getLength());
++
+             // do not update digest in case of missing or purged row level tombstones, see
CASSANDRA-8979
+             if (emptyColumnFamily.deletionInfo().getTopLevelDeletion() != DeletionTime.LIVE)
+             {
+                 digest.update(out.getData(), 0, out.getLength());
+             }
          }
          catch (IOException e)
          {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/89a8f4a7/src/java/org/apache/cassandra/repair/Validator.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/repair/Validator.java
index 641717e,5aa0cfe..8f8bf6d
--- a/src/java/org/apache/cassandra/repair/Validator.java
+++ b/src/java/org/apache/cassandra/repair/Validator.java
@@@ -24,11 -24,12 +24,11 @@@ import java.util.List
  import java.util.Random;
  
  import com.google.common.annotations.VisibleForTesting;
+ 
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
- 
  import org.apache.cassandra.concurrent.Stage;
  import org.apache.cassandra.concurrent.StageManager;
 -import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.DecoratedKey;
  import org.apache.cassandra.db.compaction.AbstractCompactedRow;
@@@ -186,7 -201,15 +191,15 @@@ public class Validator implements Runna
          // MerkleTree uses XOR internally, so we want lots of output bits here
          CountingDigest digest = new CountingDigest(FBUtilities.newMessageDigest("SHA-256"));
          row.update(digest);
-         return new MerkleTree.RowHash(row.key.getToken(), digest.digest(), digest.count);
+         // only return new hash for merkle tree in case digest was updated - see CASSANDRA-8979
+         if (digest.count > 0)
+         {
 -            return new MerkleTree.RowHash(row.key.token, digest.digest(), digest.count);
++            return new MerkleTree.RowHash(row.key.getToken(), digest.digest(), digest.count);
+         }
+         else
+         {
+             return null;
+         }
      }
  
      /**


Mime
View raw message