cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject cassandra git commit: fix bug from 6717 and 9650
Date Tue, 21 Jul 2015 16:10:14 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 5e89136d1 -> 77a6090b2


fix bug from 6717 and 9650

patch by tjake; reviewed by yukim for CASSANDRA-9787


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

Branch: refs/heads/trunk
Commit: 77a6090b24520bfa06e935783358e58fa1c37f1b
Parents: 5e89136
Author: T Jake Luciani <jake@apache.org>
Authored: Tue Jul 14 12:31:24 2015 -0400
Committer: T Jake Luciani <jake@apache.org>
Committed: Tue Jul 21 12:08:42 2015 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/commitlog/CommitLog.java        | 4 ++--
 .../unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/77a6090b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
index 14c18c9..c50beb6 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -270,9 +270,9 @@ public class CommitLog implements CommitLogMBean
             buffer.putInt((int) checksum.getValue());
 
             // checksummed mutation
-            Mutation.serializer.serialize(mutation, dos, MessagingService.current_version);
             copy = buffer.duplicate();
-            copy.limit((int) size);
+            Mutation.serializer.serialize(mutation, dos, MessagingService.current_version);
+            copy.limit(copy.position() + (int) size);
             checksum.update(copy);
             buffer.putInt((int) checksum.getValue());
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/77a6090b/test/unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java b/test/unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java
index 57e7966..e24af0f 100644
--- a/test/unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java
+++ b/test/unit/org/apache/cassandra/db/RecoveryManagerFlushedTest.java
@@ -29,6 +29,7 @@ import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.schema.KeyspaceParams;
+import org.apache.cassandra.schema.SchemaKeyspace;
 import org.apache.cassandra.utils.FBUtilities;
 
 public class RecoveryManagerFlushedTest
@@ -55,6 +56,8 @@ public class RecoveryManagerFlushedTest
     {
         // Flush everything that may be in the commit log now to start fresh
         FBUtilities.waitOnFutures(Keyspace.open(SystemKeyspace.NAME).flush());
+        FBUtilities.waitOnFutures(Keyspace.open(SchemaKeyspace.NAME).flush());
+
 
         CompactionManager.instance.disableAutoCompaction();
 


Mime
View raw message