don't wait for migration_request reply, to avoid deadlock patch by Peter Schuller; reviewed by jbellis for CASSANDRA-3832
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/72364659 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/72364659 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/72364659 Branch: refs/heads/trunk Commit: 72364659f16f415dec104112ee5fa286674d278f Parents: 3459c38 Author: Jonathan Ellis <jbel...@apache.org> Authored: Sun Feb 5 17:22:40 2012 -0600 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Tue Feb 7 13:09:40 2012 -0600 ---------------------------------------------------------------------- CHANGES.txt | 2 +- .../apache/cassandra/service/MigrationManager.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/72364659/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 48a8074..cf0b201 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -52,7 +52,7 @@ * Allow rangeSlice queries to be start/end inclusive/exclusive (CASSANDRA-3749) * Fix BulkLoader to support new SSTable layout and add stream throttling to prevent an NPE when there is no yaml config (CASSANDRA-3752) - * Allow concurrent schema migrations (CASSANDRA-1391) + * Allow concurrent schema migrations (CASSANDRA-1391, 3832) * Add SnapshotCommand to trigger snapshot on remote node (CASSANDRA-3721) * Make CFMetaData conversions to/from thrift/native schema inverses (CASSANDRA_3559) http://git-wip-us.apache.org/repos/asf/cassandra/blob/72364659/src/java/org/apache/cassandra/service/MigrationManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java b/src/java/org/apache/cassandra/service/MigrationManager.java index 7771815..0d8df1d 100644 --- a/src/java/org/apache/cassandra/service/MigrationManager.java +++ b/src/java/org/apache/cassandra/service/MigrationManager.java @@ -91,10 +91,13 @@ public class MigrationManager implements IEndpointStateChangeSubscriber /** * if versions differ this node sends request with local migration list to the endpoint - * and expecting to receive a list of migrations to apply locally + * and expecting to receive a list of migrations to apply locally. + * + * Do not de-ref the future because that causes distributed deadlock (CASSANDRA-3832) because we are + * running in the gossip stage. */ - Future f = StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() + StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() { public void runMayThrow() throws Exception { @@ -128,8 +131,6 @@ public class MigrationManager implements IEndpointStateChangeSubscriber } } }); - - FBUtilities.waitOnFuture(f); } public static boolean isReadyForBootstrap()