cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [3/7] git commit: Fix race when opening ColumnFamilyStore; patch by yukim reviewed by jbellis for CASSANDRA-5350
Date Thu, 14 Mar 2013 21:01:44 GMT
Fix race when opening ColumnFamilyStore; patch by yukim reviewed by jbellis for CASSANDRA-5350


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

Branch: refs/heads/trunk
Commit: ffc9bece4854c8f6aae7f672e262897d06fce50d
Parents: 3346771
Author: Yuki Morishita <yukim@apache.org>
Authored: Thu Mar 14 15:57:37 2013 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Mar 14 15:57:37 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java |    6 ------
 .../org/apache/cassandra/db/MeteredFlusher.java    |    2 +-
 .../cassandra/service/AbstractCassandraDaemon.java |    8 ++++----
 4 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ffc9bece/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index da81b66..89c8b10 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,6 +6,7 @@
  * nodetool: ability to repair specific range (CASSANDRA-5280)
  * Fix possible assertion triggered in SliceFromReadCommand (CASSANDRA-5284)
  * cqlsh: Add inet type support on Windows (ipv4-only) (CASSANDRA-4801)
+ * Fix race when initializing ColumnFamilyStore (CASSANDRA-5350)
 
 
 1.1.10

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ffc9bece/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 2781800..8d239e3 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -99,12 +99,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public static final ExecutorService postFlushExecutor = new JMXEnabledThreadPoolExecutor("MemtablePostFlusher");
 
-    static
-    {
-        // (can block if flush queue fills up, so don't put on scheduledTasks)
-        StorageService.optionalTasks.scheduleWithFixedDelay(new MeteredFlusher(), 1000, 1000,
TimeUnit.MILLISECONDS);
-    }
-
     public final Table table;
     public final String columnFamily;
     public final CFMetaData metadata;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ffc9bece/src/java/org/apache/cassandra/db/MeteredFlusher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/MeteredFlusher.java b/src/java/org/apache/cassandra/db/MeteredFlusher.java
index ca1fafa..199d2ee 100644
--- a/src/java/org/apache/cassandra/db/MeteredFlusher.java
+++ b/src/java/org/apache/cassandra/db/MeteredFlusher.java
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 
-class MeteredFlusher implements Runnable
+public class MeteredFlusher implements Runnable
 {
     private static Logger logger = LoggerFactory.getLogger(MeteredFlusher.class);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ffc9bece/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java b/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
index 2a66e73..9ab6df2 100644
--- a/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
@@ -40,10 +40,7 @@ import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ConfigurationException;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.config.Schema;
-import org.apache.cassandra.db.ColumnFamilyStore;
-import org.apache.cassandra.db.Directories;
-import org.apache.cassandra.db.SystemTable;
-import org.apache.cassandra.db.Table;
+import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.utils.CLibrary;
@@ -258,6 +255,9 @@ public abstract class AbstractCassandraDaemon implements CassandraDaemon
         };
         StorageService.optionalTasks.schedule(runnable, 5 * 60, TimeUnit.SECONDS);
 
+        // MeteredFlusher can block if flush queue fills up, so don't put on scheduledTasks
+        StorageService.optionalTasks.scheduleWithFixedDelay(new MeteredFlusher(), 1000, 1000,
TimeUnit.MILLISECONDS);
+
         SystemTable.finishStartup();
 
         // start server internals


Mime
View raw message