cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefa...@apache.org
Subject [1/3] cassandra git commit: Fix failure in LogTransactionTest
Date Thu, 29 Sep 2016 01:30:48 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 9dd805d0d -> 5cebd1fb0
  refs/heads/trunk 3a79a027c -> 25d4c7baa


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/cassandra-3.0
Commit: 5cebd1fb0d60e23ae5a30231e253806d58d0998e
Parents: 9dd805d
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Tue Sep 13 14:51:56 2016 +0800
Committer: Stefania Alborghetti <stefania.alborghetti@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


Mime
View raw message