cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [1/3] cassandra git commit: Remove identity sstable from Lifecycle transaction on cancel
Date Tue, 11 Aug 2015 19:05:00 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 3462a23dc -> b11be4da5


Remove identity sstable from Lifecycle transaction on cancel

Patch by cmoos; reviewed by jmckenzie for CASSANDRA-10008


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

Branch: refs/heads/trunk
Commit: 1960e5b367d35020e95d84cae3fe6bad7fff14f1
Parents: 6c72310
Author: Chris Moos <chris@chrismoos.com>
Authored: Tue Aug 11 15:02:00 2015 -0400
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Tue Aug 11 15:02:00 2015 -0400

----------------------------------------------------------------------
 .../org/apache/cassandra/db/lifecycle/LifecycleTransaction.java   | 3 ++-
 .../apache/cassandra/db/lifecycle/LifecycleTransactionTest.java   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1960e5b3/src/java/org/apache/cassandra/db/lifecycle/LifecycleTransaction.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/lifecycle/LifecycleTransaction.java b/src/java/org/apache/cassandra/db/lifecycle/LifecycleTransaction.java
index e14e2a1..dfa30c7 100644
--- a/src/java/org/apache/cassandra/db/lifecycle/LifecycleTransaction.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/LifecycleTransaction.java
@@ -386,6 +386,7 @@ public class LifecycleTransaction extends Transactional.AbstractTransactional
         assert !(staged.contains(cancel) || logged.contains(cancel)) : "may only cancel a
reader that has not been updated or obsoleted in this transaction: " + cancel;
         originals.remove(cancel);
         marked.remove(cancel);
+        identities.remove(cancel.instanceId);
         maybeFail(unmarkCompacting(singleton(cancel), null));
     }
 
@@ -515,4 +516,4 @@ public class LifecycleTransaction extends Transactional.AbstractTransactional
     {
         return originals.toString();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1960e5b3/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java b/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
index aaa9999..f13d1b7 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
@@ -185,9 +185,10 @@ public class LifecycleTransactionTest extends AbstractTransactionalTest
     {
         ColumnFamilyStore cfs = MockSchema.newCFS();
         Tracker tracker = new Tracker(null, false);
-        List<SSTableReader> readers = readers(0, 3, cfs);
+        List<SSTableReader> readers = readers(0, 4, cfs);
         tracker.addInitialSSTables(readers);
         LifecycleTransaction txn = tracker.tryModify(readers, OperationType.UNKNOWN);
+        txn.cancel(readers.get(3));
         LifecycleTransaction txn2 = txn.split(readers.subList(0, 1));
         Assert.assertEquals(2, txn.originals().size());
         Assert.assertTrue(all(readers.subList(1, 3), in(txn.originals())));


Mime
View raw message