You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2013/09/23 16:42:46 UTC

[2/3] git commit: Fix insertion of collections with CAS

Fix insertion of collections with CAS

patch by slebresne; reviewed by iamaleksey for CASSANDRA-6069


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

Branch: refs/heads/trunk
Commit: fb55849795ca918f08412fc00fb1a8b8eaa13065
Parents: ba59423
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Mon Sep 23 16:41:45 2013 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Mon Sep 23 16:41:45 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                             | 3 ++-
 src/java/org/apache/cassandra/service/paxos/Commit.java | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb558497/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cd23fbf..88daf35 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,11 +1,12 @@
 2.0.2
  * Move batchlog replay to its own executor (CASSANDRA-6079)
+ * Fix thrift validation refusing row markers on CQL3 tables (CASSANDRA-6081)
+ * Fix insertion of collections with CAS (CASSANDRA-6069)
 Merged from 1.2:
  * Improve memory usage of metadata min/max column names (CASSANDRA-6077)
  * Allow where clause conditions to be in parenthesis (CASSANDRA-6037)
  * Do not open non-ssl storage port if encryption option is all (CASSANDRA-3916)
  * Improve memory usage of metadata min/max column names (CASSANDRA-6077)
- * Fix thrift validation refusing row markers on CQL3 tables (CASSANDRA-6081)
 
 
 2.0.1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fb558497/src/java/org/apache/cassandra/service/paxos/Commit.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/paxos/Commit.java b/src/java/org/apache/cassandra/service/paxos/Commit.java
index 84589cc..9904045 100644
--- a/src/java/org/apache/cassandra/service/paxos/Commit.java
+++ b/src/java/org/apache/cassandra/service/paxos/Commit.java
@@ -116,7 +116,10 @@ public class Commit
     {
         ColumnFamily cf = updates.cloneMeShallow();
         long t = UUIDGen.microsTimestamp(ballot);
-        cf.deletionInfo().updateAllTimestamp(t);
+        // For the tombstones, we use t-1 so that when insert a collection literall, the range tombstone that deletes the previous values of
+        // the collection and we want that to have a lower timestamp and our new values. Since tombstones wins over normal insert, using t-1
+        // should not be a problem in general (see #6069).
+        cf.deletionInfo().updateAllTimestamp(t-1);
         for (Column column : updates)
             cf.addAtom(column.withUpdatedTimestamp(t));
         return cf;