You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/08/24 01:17:54 UTC

[1/2] git commit: Fix periodic memtable flushing behavior with clean memtables

Updated Branches:
  refs/heads/cassandra-2.0 56008de45 -> 78d78cf64


Fix periodic memtable flushing behavior with clean memtables

patch by Aleksey Yeschenko; reviewed by Jonathan Ellis for
CASSANDRA-5931


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

Branch: refs/heads/cassandra-2.0
Commit: b0280cb92d6d0ee5e89d54d2277ba846172de61e
Parents: af9c707
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Sat Aug 24 02:15:32 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Sat Aug 24 02:16:29 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  | 22 ++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0280cb9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 16c6e58..b68e442 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,6 @@
 2.0.0
  * Fix thrift validation when inserting into CQL3 tables (CASSANDRA-5138)
+ * Fix periodic memtable flushing behavior with clean memtables (CASSANDRA-5931)
 Merged from 1.2:
  * Fix getBloomFilterDiskSpaceUsed for AlwaysPresentFilter (CASSANDRA-5900)
  * Don't announce schema version until we've loaded the changes locally

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0280cb9/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index b6e2f3c..f3acf4d 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -166,11 +166,12 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
                 {
                     if (getMemtableThreadSafe().isExpired())
                     {
-                        Future<?> future = forceFlush();
                         // if memtable is already expired but didn't flush because it's empty,
                         // then schedule another flush.
-                        if (future == null)
+                        if (isClean())
                             scheduleFlush();
+                        else
+                            forceFlush(); // scheduleFlush() will be called by the constructor of the new memtable.
                     }
                 }
             };
@@ -777,15 +778,24 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         }
     }
 
-    public Future<?> forceFlush()
+    private boolean isClean()
     {
         // during index build, 2ary index memtables can be dirty even if parent is not.  if so,
         // we want flushLargestMemtables to flush the 2ary index ones too.
-        boolean clean = true;
         for (ColumnFamilyStore cfs : concatWithIndexes())
-            clean &= cfs.getMemtableThreadSafe().isClean();
+            if (!cfs.getMemtableThreadSafe().isClean())
+                return false;
+
+        return true;
+    }
 
-        if (clean)
+    /**
+     * @return a future, with a guarantee that any data inserted prior to the forceFlush() call is fully flushed
+     *         by the time future.get() returns. Never returns null.
+     */
+    public Future<?> forceFlush()
+    {
+        if (isClean())
         {
             // We could have a memtable for this column family that is being
             // flushed. Make sure the future returned wait for that so callers can


[2/2] git commit: Merge branch 'cassandra-2.0.0' into cassandra-2.0

Posted by al...@apache.org.
Merge branch 'cassandra-2.0.0' into cassandra-2.0


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

Branch: refs/heads/cassandra-2.0
Commit: 78d78cf649d65ad16fdcbc54bb69f6b23bd7f2e6
Parents: 56008de b0280cb
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Sat Aug 24 02:17:38 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Sat Aug 24 02:17:38 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/cassandra/db/ColumnFamilyStore.java  | 22 ++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/78d78cf6/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 2d30407,b68e442..988255b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,17 -1,6 +1,18 @@@
 +2.0.1
 + * Notify indexer of columns shadowed by range tombstones (CASSANDRA-5614)
 + * Log Merkle tree stats (CASSANDRA-2698)
 + * Switch from crc32 to adler32 for compressed sstable checksums (CASSANDRA-5862)
 + * Improve offheap memcpy performance (CASSANDRA-5884)
 + * Use a range aware scanner for cleanup (CASSANDRA-2524)
 + * Cleanup doesn't need to inspect sstables that contain only local data 
 +   (CASSANDRA-5722)
 + * Add ability for CQL3 to list partition keys (CASSANDRA-4536)
 + * Improve native protocol serialization (CASSANDRA-5664)
 +
 +
  2.0.0
   * Fix thrift validation when inserting into CQL3 tables (CASSANDRA-5138)
+  * Fix periodic memtable flushing behavior with clean memtables (CASSANDRA-5931)
  Merged from 1.2:
   * Fix getBloomFilterDiskSpaceUsed for AlwaysPresentFilter (CASSANDRA-5900)
   * Don't announce schema version until we've loaded the changes locally

http://git-wip-us.apache.org/repos/asf/cassandra/blob/78d78cf6/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------