cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [3/4] git commit: Fix batchlogManager#deleteBatch() use of millisecond timsestamps
Date Tue, 01 Apr 2014 01:23:05 GMT
Fix batchlogManager#deleteBatch() use of millisecond timsestamps

patch by Aleksey Yeschenko; reviewed by Pavel Yaskevich for
CASSANDRA-6822


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

Branch: refs/heads/cassandra-2.0
Commit: dc3f22b61d988d559d0078c557623d07abef8584
Parents: 05fcfa2
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Tue Apr 1 04:16:48 2014 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Apr 1 04:16:48 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                                | 5 +++++
 src/java/org/apache/cassandra/db/BatchlogManager.java      | 2 +-
 test/unit/org/apache/cassandra/db/BatchlogManagerTest.java | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dc3f22b6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fa46c2e..a9a93a4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,8 @@
+1.2.17
+ * Fix BatchlogManager#deleteBatch() use of millisecond timsestamps
+   (CASSANDRA-6822)
+
+
 1.2.16
  * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
  * add extra SSL cipher suites (CASSANDRA-6613)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dc3f22b6/src/java/org/apache/cassandra/db/BatchlogManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/BatchlogManager.java b/src/java/org/apache/cassandra/db/BatchlogManager.java
index 90dfd47..7bfbf0c 100644
--- a/src/java/org/apache/cassandra/db/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/db/BatchlogManager.java
@@ -246,7 +246,7 @@ public class BatchlogManager implements BatchlogManagerMBean
     private void deleteBatch(UUID id)
     {
         RowMutation mutation = new RowMutation(Table.SYSTEM_KS, UUIDType.instance.decompose(id));
-        mutation.delete(new QueryPath(SystemTable.BATCHLOG_CF, null, null), System.currentTimeMillis());
+        mutation.delete(new QueryPath(SystemTable.BATCHLOG_CF, null, null), FBUtilities.timestampMicros());
         mutation.apply();
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dc3f22b6/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
index 08728fc..1d89f4b 100644
--- a/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/BatchlogManagerTest.java
@@ -67,6 +67,9 @@ public class BatchlogManagerTest extends SchemaLoader
             BatchlogManager.getBatchlogMutationFor(Collections.singleton(mutation), UUIDGen.getTimeUUID(),
timestamp * 1000).apply();
         }
 
+        // Flush the batchlog to disk (see CASSANDRA-6822).
+        Table.open(Table.SYSTEM_KS).getColumnFamilyStore(SystemTable.BATCHLOG_CF).forceFlush();
+
         assertEquals(1000, BatchlogManager.instance.countAllBatches());
         assertEquals(0, BatchlogManager.instance.getTotalBatchesReplayed());
 


Mime
View raw message