You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by st...@apache.org on 2016/09/29 01:30:49 UTC

[2/3] cassandra git commit: Fix failure in LogTransactionTest

Fix failure in LogTransactionTest

Patch by Stefania Alborghetti; reviewed by Edward Capriolo for CASSANDRA-12632


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

Branch: refs/heads/trunk
Commit: 5cebd1fb0d60e23ae5a30231e253806d58d0998e
Parents: 9dd805d
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Tue Sep 13 14:51:56 2016 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Thu Sep 29 09:27:18 2016 +0800

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../cassandra/db/lifecycle/LogTransactionTest.java    | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cebd1fb/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6edc491..f2f8dac 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.10
+ * Fix failure in LogTransactionTest (CASSANDRA-12632)
  * Fix potentially incomplete non-frozen UDT values when querying with the
    full primary key specified (CASSANDRA-12605)
  * Skip writing MV mutations to commitlog on mutation.applyUnsafe() (CASSANDRA-11670)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5cebd1fb/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
index 0f03baf..56df337 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
@@ -1003,11 +1003,15 @@ public class LogTransactionTest extends AbstractTransactionalTest
         assertNotNull(log);
 
         log.trackNew(sstableNew);
-        log.obsoleted(sstableOld);
+        LogTransaction.SSTableTidier tidier = log.obsoleted(sstableOld);
 
         // Modify the transaction log or disk state for sstableOld
         modifier.accept(log, sstableOld);
 
+        // Sync the folder to make sure that later on removeUnfinishedLeftovers picks up
+        // any changes to the txn files done by the modifier
+        assertNull(log.txnFile().syncFolder(null));
+
         assertNull(log.complete(null));
 
         sstableOld.selfRef().release();
@@ -1040,6 +1044,9 @@ public class LogTransactionTest extends AbstractTransactionalTest
                                                                                oldFiles,
                                                                                log.logFilePaths())));
         }
+
+        // make sure to run the tidier to avoid any leaks in the logs
+        tidier.run();
     }
 
     @Test
@@ -1068,7 +1075,7 @@ public class LogTransactionTest extends AbstractTransactionalTest
         assertNotNull(log);
 
         log.trackNew(sstableNew);
-        /*TransactionLog.SSTableTidier tidier =*/ log.obsoleted(sstableOld);
+        LogTransaction.SSTableTidier tidier = log.obsoleted(sstableOld);
 
         //modify the old sstable files
         modifier.accept(sstableOld);
@@ -1093,6 +1100,9 @@ public class LogTransactionTest extends AbstractTransactionalTest
         assertFiles(dataFolder.getPath(), Sets.newHashSet(Iterables.concat(sstableNew.getAllFilePaths(),
                                                                            sstableOld.getAllFilePaths(),
                                                                            log.logFilePaths())));
+
+        // make sure to run the tidier to avoid any leaks in the logs
+        tidier.run();
     }
 
     @Test