cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/2] git commit: add shutdown to MS.waitForStreaming. Fixes regression in #3335
Date Wed, 28 Dec 2011 15:53:05 GMT
add shutdown to MS.waitForStreaming.  Fixes regression in #3335


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

Branch: refs/heads/trunk
Commit: 02346a1e6a4523077f1e7d6fdc0c931f53abbc59
Parents: c68e90b
Author: Jonathan Ellis <jbellis@gmail.com>
Authored: Wed Dec 28 09:12:46 2011 -0600
Committer: Jonathan Ellis <jbellis@gmail.com>
Committed: Wed Dec 28 09:12:46 2011 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/net/MessagingService.java |    1 +
 .../apache/cassandra/service/StorageService.java   |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/02346a1e/src/java/org/apache/cassandra/net/MessagingService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index e7c86b9..1526fa3 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -465,6 +465,7 @@ public final class MessagingService implements MessagingServiceMBean
 
     public void waitForStreaming() throws InterruptedException
     {
+        streamExecutor_.shutdown();
         streamExecutor_.awaitTermination(24, TimeUnit.HOURS);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/02346a1e/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index e5bff92..9c1195d 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2492,7 +2492,12 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
         return String.format("Drained %s/%s ColumnFamilies", remainingCFs, totalCFs);
     }
 
-    /** shuts node off to writes, empties memtables and the commit log. */
+    /**
+     * Shuts node off to writes, empties memtables and the commit log.
+     * There are two differences between drain and the normal shutdown hook:
+     * - Drain waits for in-progress streaming to complete
+     * - Drain flushes *all* columnfamilies (shutdown hook only flushes non-durable CFs)
+     */
     public synchronized void drain() throws IOException, InterruptedException, ExecutionException
     {
         ExecutorService mutationStage = StageManager.getStage(Stage.MUTATION);


Mime
View raw message