Repository: cassandra
Updated Branches:
  refs/heads/trunk 1753f3749 -> 6e7934280


Fix marking commitlog segments clean
patch by bes; reviewed by jbellis for CASSANDRA-6959


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

Branch: refs/heads/trunk
Commit: 7da562053fe729adb41061e52bfda17837f77d62
Parents: af80201
Author: Jonathan Ellis <jbel...@apache.org>
Authored: Thu May 8 10:51:36 2014 -0500
Committer: Jonathan Ellis <jbel...@apache.org>
Committed: Thu May 8 10:51:59 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                      | 1 +
 src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7da56205/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 714a475..5afe800 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.0-rc1
+ * Fix marking commitlogsegments clean (CASSANDRA-6959)
  * Add snapshot "manifest" describing files included (CASSANDRA-6326)
  * Parallel streaming for sstableloader (CASSANDRA-3668)
  * Fix bugs in supercolumns handling (CASSANDRA-7138)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7da56205/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 e5c9b3e..3830966 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
@@ -469,7 +469,7 @@ public class CommitLogSegment
             UUID cfId = clean.getKey();
             AtomicInteger cleanPos = clean.getValue();
             AtomicInteger dirtyPos = cfDirty.get(cfId);
-            if (dirtyPos != null && dirtyPos.intValue() < cleanPos.intValue())
+            if (dirtyPos != null && dirtyPos.intValue() <= cleanPos.intValue())
             {
                 cfDirty.remove(cfId);
                 iter.remove();
@@ -482,9 +482,9 @@ public class CommitLogSegment
      */
     public synchronized Collection<UUID> getDirtyCFIDs()
     {
-        removeCleanFromDirty();
         if (cfClean.isEmpty() || cfDirty.isEmpty())
             return cfDirty.keySet();
+
         List<UUID> r = new ArrayList<>(cfDirty.size());
         for (Map.Entry<UUID, AtomicInteger> dirty : cfDirty.entrySet())
         {

Reply via email to