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 2017/04/04 10:26:07 UTC

[1/6] cassandra git commit: Fix the conversion of 2.X expired rows without regular column data

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 2e36eb6ca -> 462b9cf63
  refs/heads/cassandra-3.11 420c91c9a -> 6b87e49c3
  refs/heads/trunk f87ec773f -> 0f054fee5


Fix the conversion of 2.X expired rows without regular column data

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


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

Branch: refs/heads/cassandra-3.0
Commit: 462b9cf63bf986671f8a080ef1802f0c27e7c772
Parents: 2e36eb6
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 11:57:41 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 11:57:41 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 41489c1..4126b07 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.13
+ * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395)
  * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020)
  * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389)
  * Legacy deserializer can create empty range tombstones (CASSANDRA-13341)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/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 bfe3bff..669fb1c 100644
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@ -1128,6 +1128,11 @@ public abstract class LegacyLayout
 
     public static class CellGrouper
     {
+        /**
+         * The fake TTL used for expired rows that have been compacted.
+         */
+        private static final int FAKE_TTL = 1;
+
         public final CFMetaData metadata;
         private final boolean isStatic;
         private final SerializationHelper helper;
@@ -1194,14 +1199,17 @@ public abstract class LegacyLayout
             {
                 // It's the row marker
                 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.
+                // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction.
+                // If we do not set the primary key liveness info for this row and it does not contains any regular columns
+                // the row will be empty. To avoid that, we reuse the localDeletionTime but use a fake TTL.
                 // 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
+                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, FAKE_TTL, cell.localDeletionTime));
             }
             else
             {


[3/6] cassandra git commit: Fix the conversion of 2.X expired rows without regular column data

Posted by bl...@apache.org.
Fix the conversion of 2.X expired rows without regular column data

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


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

Branch: refs/heads/trunk
Commit: 462b9cf63bf986671f8a080ef1802f0c27e7c772
Parents: 2e36eb6
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 11:57:41 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 11:57:41 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 41489c1..4126b07 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.13
+ * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395)
  * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020)
  * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389)
  * Legacy deserializer can create empty range tombstones (CASSANDRA-13341)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/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 bfe3bff..669fb1c 100644
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@ -1128,6 +1128,11 @@ public abstract class LegacyLayout
 
     public static class CellGrouper
     {
+        /**
+         * The fake TTL used for expired rows that have been compacted.
+         */
+        private static final int FAKE_TTL = 1;
+
         public final CFMetaData metadata;
         private final boolean isStatic;
         private final SerializationHelper helper;
@@ -1194,14 +1199,17 @@ public abstract class LegacyLayout
             {
                 // It's the row marker
                 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.
+                // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction.
+                // If we do not set the primary key liveness info for this row and it does not contains any regular columns
+                // the row will be empty. To avoid that, we reuse the localDeletionTime but use a fake TTL.
                 // 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
+                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, FAKE_TTL, cell.localDeletionTime));
             }
             else
             {


[4/6] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11

Posted by bl...@apache.org.
Merge branch cassandra-3.0 into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: 6b87e49c377731b0347ce2a0fb2db3da2a13ec3f
Parents: 420c91c 462b9cf
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 12:01:07 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 12:01:07 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b87e49c/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index fc7a2bb,4126b07..e63e266
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,5 +1,25 @@@
 -3.0.13
 +3.11.0
 + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820)
 + * cdc column addition strikes again (CASSANDRA-13382)
 + * Fix static column indexes (CASSANDRA-13277) 
 + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298)
 + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370)
 + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247)
 + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317)
 + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366)
 + * Support unaligned memory access for AArch64 (CASSANDRA-13326)
 + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915).
 + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174)
 + * Obfuscate password in stress-graphs (CASSANDRA-12233)
 + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034)
 + * nodetool stopdaemon errors out (CASSANDRA-13030)
 + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954)
 + * Fix primary index calculation for SASI (CASSANDRA-12910)
 + * More fixes to the TokenAllocator (CASSANDRA-12990)
 + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983)
 + * Address message coalescing regression (CASSANDRA-12676)
 +Merged from 3.0:
+  * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395)
   * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020)
   * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389)
   * Legacy deserializer can create empty range tombstones (CASSANDRA-13341)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b87e49c/src/java/org/apache/cassandra/db/LegacyLayout.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/LegacyLayout.java
index e218fd1,669fb1c..9a7131e
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@@ -1195,15 -1199,17 +1200,18 @@@ public abstract class LegacyLayou
              {
                  // It's the row marker
                  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.
+                 // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction.
+                 // If we do not set the primary key liveness info for this row and it does not contains any regular columns
+                 // the row will be empty. To avoid that, we reuse the localDeletionTime but use a fake TTL.
                  // 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));
 +                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.withExpirationTime(cell.timestamp, cell.ttl, cell.localDeletionTime));
                  else if (metadata.isIndex())
                      builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(cell.timestamp, cell.localDeletionTime)));
+                 else
+                     builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, FAKE_TTL, cell.localDeletionTime));
              }
              else
              {


[5/6] cassandra git commit: Merge branch cassandra-3.0 into cassandra-3.11

Posted by bl...@apache.org.
Merge branch cassandra-3.0 into cassandra-3.11


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

Branch: refs/heads/cassandra-3.11
Commit: 6b87e49c377731b0347ce2a0fb2db3da2a13ec3f
Parents: 420c91c 462b9cf
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 12:01:07 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 12:01:07 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b87e49c/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index fc7a2bb,4126b07..e63e266
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,5 +1,25 @@@
 -3.0.13
 +3.11.0
 + * Fix testLimitSSTables flake caused by concurrent flush (CASSANDRA-12820)
 + * cdc column addition strikes again (CASSANDRA-13382)
 + * Fix static column indexes (CASSANDRA-13277) 
 + * DataOutputBuffer.asNewBuffer broken (CASSANDRA-13298)
 + * unittest CipherFactoryTest failed on MacOS (CASSANDRA-13370)
 + * Forbid SELECT restrictions and CREATE INDEX over non-frozen UDT columns (CASSANDRA-13247)
 + * Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern (CASSANDRA-13317)
 + * Possible AssertionError in UnfilteredRowIteratorWithLowerBound (CASSANDRA-13366)
 + * Support unaligned memory access for AArch64 (CASSANDRA-13326)
 + * Improve SASI range iterator efficiency on intersection with an empty range (CASSANDRA-12915).
 + * Fix equality comparisons of columns using the duration type (CASSANDRA-13174)
 + * Obfuscate password in stress-graphs (CASSANDRA-12233)
 + * Move to FastThreadLocalThread and FastThreadLocal (CASSANDRA-13034)
 + * nodetool stopdaemon errors out (CASSANDRA-13030)
 + * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954)
 + * Fix primary index calculation for SASI (CASSANDRA-12910)
 + * More fixes to the TokenAllocator (CASSANDRA-12990)
 + * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983)
 + * Address message coalescing regression (CASSANDRA-12676)
 +Merged from 3.0:
+  * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395)
   * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020)
   * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389)
   * Legacy deserializer can create empty range tombstones (CASSANDRA-13341)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6b87e49c/src/java/org/apache/cassandra/db/LegacyLayout.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/LegacyLayout.java
index e218fd1,669fb1c..9a7131e
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@@ -1195,15 -1199,17 +1200,18 @@@ public abstract class LegacyLayou
              {
                  // It's the row marker
                  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.
+                 // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction.
+                 // If we do not set the primary key liveness info for this row and it does not contains any regular columns
+                 // the row will be empty. To avoid that, we reuse the localDeletionTime but use a fake TTL.
                  // 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));
 +                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.withExpirationTime(cell.timestamp, cell.ttl, cell.localDeletionTime));
                  else if (metadata.isIndex())
                      builder.addRowDeletion(Row.Deletion.regular(new DeletionTime(cell.timestamp, cell.localDeletionTime)));
+                 else
+                     builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, FAKE_TTL, cell.localDeletionTime));
              }
              else
              {


[6/6] cassandra git commit: Merge branch cassandra-3.11 into trunk

Posted by bl...@apache.org.
Merge branch cassandra-3.11 into trunk


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

Branch: refs/heads/trunk
Commit: 0f054fee5cad7e326d0c3284aaf71d251944a08f
Parents: f87ec77 6b87e49
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 12:17:30 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 12:17:38 2017 +0200

----------------------------------------------------------------------

----------------------------------------------------------------------



[2/6] cassandra git commit: Fix the conversion of 2.X expired rows without regular column data

Posted by bl...@apache.org.
Fix the conversion of 2.X expired rows without regular column data

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


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

Branch: refs/heads/cassandra-3.11
Commit: 462b9cf63bf986671f8a080ef1802f0c27e7c772
Parents: 2e36eb6
Author: Benjamin Lerer <b....@gmail.com>
Authored: Tue Apr 4 11:57:41 2017 +0200
Committer: Benjamin Lerer <b....@gmail.com>
Committed: Tue Apr 4 11:57:41 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 41489c1..4126b07 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.13
+ * Fix the conversion of 2.X expired rows without regular column data (CASSANDRA-13395)
  * Fix hint delivery when using ext+internal IPs with prefer_local enabled (CASSANDRA-13020)
  * Fix possible NPE on upgrade to 3.0/3.X in case of IO errors (CASSANDRA-13389)
  * Legacy deserializer can create empty range tombstones (CASSANDRA-13341)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/462b9cf6/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 bfe3bff..669fb1c 100644
--- a/src/java/org/apache/cassandra/db/LegacyLayout.java
+++ b/src/java/org/apache/cassandra/db/LegacyLayout.java
@@ -1128,6 +1128,11 @@ public abstract class LegacyLayout
 
     public static class CellGrouper
     {
+        /**
+         * The fake TTL used for expired rows that have been compacted.
+         */
+        private static final int FAKE_TTL = 1;
+
         public final CFMetaData metadata;
         private final boolean isStatic;
         private final SerializationHelper helper;
@@ -1194,14 +1199,17 @@ public abstract class LegacyLayout
             {
                 // It's the row marker
                 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.
+                // In 2.1, the row marker expired cell might have been converted into a deleted one by compaction.
+                // If we do not set the primary key liveness info for this row and it does not contains any regular columns
+                // the row will be empty. To avoid that, we reuse the localDeletionTime but use a fake TTL.
                 // 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
+                    builder.addPrimaryKeyLivenessInfo(LivenessInfo.create(cell.timestamp, FAKE_TTL, cell.localDeletionTime));
             }
             else
             {