cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/2] git commit: Race condition in Batch CLE
Date Fri, 14 Mar 2014 18:17:07 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 59695a254 -> 51a5106c9


Race condition in Batch CLE

patch by belliottsmith reviewed by dbrosius for cassandra-6860


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

Branch: refs/heads/trunk
Commit: 5ddeba3365a41e682e3e9fa19e7a790f6b2bcd34
Parents: 74ac6e8
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri Mar 14 14:13:46 2014 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri Mar 14 14:13:46 2014 -0400

----------------------------------------------------------------------
 CHANGES.txt                                               |  2 ++
 .../apache/cassandra/db/commitlog/CommitLogSegment.java   | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5ddeba33/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 24c8090..1d7c2db 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,8 @@
  * Fix help message for stress counter_write (CASSANDRA-6824)
  * Fix stress smart Thrift client to pick servers correctly (CASSANDRA-6848)
  * Add logging levels (minimal, normal or verbose) to stress tool (CASSANDRA-6849)
+ * Fix race condition in Batch CLE (CASSANDRA-6860)
+ 
 Merged from 2.0:
  * Fix leaking validator FH in StreamWriter (CASSANDRA-6832)
  * fix nodetool getsstables for blob PK (CASSANDRA-6803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5ddeba33/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
index 9caba6d..718ddda 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
@@ -314,16 +314,16 @@ public class CommitLogSegment
 
             // actually perform the sync and signal those waiting for it
             buffer.force();
-            syncComplete.signalAll();
 
             if (close)
-            {
-                close();
                 nextMarker = buffer.capacity();
-            }
-            CLibrary.trySkipCache(fd, offset, nextMarker);
 
             lastSyncedOffset = nextMarker;
+            syncComplete.signalAll();
+
+            CLibrary.trySkipCache(fd, offset, nextMarker);
+            if (close)
+                close();
         }
         catch (Exception e) // MappedByteBuffer.force() does not declare IOException but
can actually throw it
         {


Mime
View raw message