cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [3/6] cassandra git commit: Propagate row deletion info for 2i tables on upgrade
Date Fri, 17 Mar 2017 11:16:22 GMT
Propagate row deletion info for 2i tables on upgrade

Patch by Sam Tunnicliffe; reviewed by Benjamin Lerer for CASSANDRA-13320


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

Branch: refs/heads/trunk
Commit: 5918375e88bcacfab47e44cbfa2dd202ec634725
Parents: 0c07840
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Wed Mar 15 15:54:20 2017 +0000
Committer: Sam Tunnicliffe <sam@beobal.com>
Committed: Fri Mar 17 10:45:48 2017 +0000

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5918375e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7232d5e..2017b78 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.13
+ * Propagate row deletions in 2i tables on upgrade (CASSANDRA-13320)
  * Slice.isEmpty() returns false for some empty slices (CASSANDRA-13305)
  * Add formatted row output to assertEmpty in CQL Tester (CASSANDRA-13238)
 Merged from 2.2:

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5918375e/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 972bb9f..bfe3bff 100644
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@ -1196,8 +1196,12 @@ public abstract class LegacyLayout
                 assert !cell.value.hasRemaining();
                 // 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.
+                // The only time in 2.x that we actually delete a row marker is in 2i tables,
so in that case we do
+                // want to actually propagate the row deletion. (CASSANDRA-13320)
                 if (!cell.isTombstone())
                     builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp,
cell.ttl, cell.localDeletionTime));
+                else if (metadata.isIndex())
+                    builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(cell.timestamp,
cell.localDeletionTime)));
             }
             else
             {


Mime
View raw message