You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2016/12/16 11:19:28 UTC

cassandra git commit: Fix deserialization of 2.x DeletedCells

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 225677872 -> c612cd8d7


Fix deserialization of 2.x DeletedCells

patch by Benjamin Lerer; reviewed by Sylvain Lebresne for CASSANDRA-12620


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

Branch: refs/heads/cassandra-3.0
Commit: c612cd8d7dbd24888c216ad53f974686b88dd601
Parents: 2256778
Author: Benjamin Lerer <b....@gmail.com>
Authored: Thu Dec 15 11:29:39 2016 +0100
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Fri Dec 16 12:18:56 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        | 1 +
 src/java/org/apache/cassandra/db/LegacyLayout.java | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c612cd8d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a40dabd..5eeeeae 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.11
+ * Fix deserialization of 2.x DeletedCells (CASSANDRA-12620)
  * Add parent repair session id to anticompaction log message (CASSANDRA-12186)
  * Improve contention handling on failure to acquire MV lock for streaming and hints (CASSANDRA-12905)
  * Fix DELETE and UPDATE queries with empty IN restrictions (CASSANDRA-12829)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c612cd8d/src/java/org/apache/cassandra/db/LegacyLayout.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/LegacyLayout.java b/src/java/org/apache/cassandra/db/LegacyLayout.java
index c8e7536..3f69671 100644
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@ -1194,7 +1194,10 @@ public abstract class LegacyLayout
             {
                 // It's the row marker
                 assert !cell.value.hasRemaining();
-                builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, cell.ttl, cell.localDeletionTime));
+                // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction. So,
+                // we need to set the primary key liveness info only if the cell is not a deleted one.
+                if (!cell.isTombstone())
+                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, cell.ttl, cell.localDeletionTime));
             }
             else
             {