Merge branch 'cassandra-2.1' into trunk

This commit is contained in:
Aleksey Yeschenko 2015-01-07 22:52:13 +03:00
commit 6041d41cd8
3 changed files with 12 additions and 5 deletions

View File

@ -93,8 +93,7 @@
* Log failed host when preparing incremental repair (CASSANDRA-8228)
* Force config client mode in CQLSSTableWriter (CASSANDRA-8281)
Merged from 2.0:
=======
2.0.12:
* Add an extra version check to MigrationTask (CASSANDRA-8462)
* Ensure SSTableWriter cleans up properly after failure (CASSANDRA-8499)
* Increase bf true positive count on key cache hit (CASSANDRA-8525)
* Move MeteredFlusher to its own thread (CASSANDRA-8485)

View File

@ -142,7 +142,7 @@ public class MigrationManager
return StageManager.getStage(Stage.MIGRATION).submit(new MigrationTask(endpoint));
}
private static boolean shouldPullSchemaFrom(InetAddress endpoint)
public static boolean shouldPullSchemaFrom(InetAddress endpoint)
{
/*
* Don't request schema from nodes with a differnt or unknonw major version (may have incompatible schema)

View File

@ -48,7 +48,14 @@ class MigrationTask extends WrappedRunnable
public void runMayThrow() throws Exception
{
MessageOut message = new MessageOut<>(MessagingService.Verb.MIGRATION_REQUEST, null, MigrationManager.MigrationsSerializer.instance);
// There is a chance that quite some time could have passed between now and the MM#maybeScheduleSchemaPull(),
// potentially enough for the endpoint node to restart - which is an issue if it does restart upgraded, with
// a higher major.
if (!MigrationManager.shouldPullSchemaFrom(endpoint))
{
logger.info("Skipped sending a migration request: node {} has a higher major version now.", endpoint);
return;
}
if (!FailureDetector.instance.isAlive(endpoint))
{
@ -56,6 +63,8 @@ class MigrationTask extends WrappedRunnable
return;
}
MessageOut message = new MessageOut<>(MessagingService.Verb.MIGRATION_REQUEST, null, MigrationManager.MigrationsSerializer.instance);
IAsyncCallback<Collection<Mutation>> cb = new IAsyncCallback<Collection<Mutation>>()
{
@Override
@ -75,7 +84,6 @@ class MigrationTask extends WrappedRunnable
}
}
@Override
public boolean isLatencyForSnitch()
{
return false;