CASSANDRA-1292
Multiple migration might run at once.
Background:
Migration is a process/feature in cassandra which moves the database from one keyspace to another. The use case can be migrating (enlarging) from 3 node cluster to 10 node cluster.
wrong computation
Critical
yes, InvalidRequestException
no
no
single cluster
no, no dataloss
0.7beta1
Standard configuration before migration. Add one more node during migration.
2
1) add empty node
2) start cassandra migration (feature start)
2
yes
yes
yes
2
medium
yes
After defining a new keyspace. We need to run database migration. During the migration phase, multiple migrations ran at the same time.
Backwards inference requires lots of domain knowledge. The service.MigrationManager class manages a MIGRATION_STAGE where nodes should execute db.migration.Migration instances.
The problem is that the node that a client connects to via Thrift or Avro initiates the migration in their client thread (calls migration.apply). Instead, the Thrift and Avro clients should ensure that the migration occurs in MIGRATION_STAGE, and should block until the migration is applied by the stage.
To summarize, the client should block further migration attempts if one migration is already in progress. Also, when applying the migration through a client, the database should be put into “MIGRATION_STAGE”.
Implementation of migration feature on the client is incorrect. Cassandra needs to be put into MIGRATION_STAGE mode in order to perform migration.
semantic
The fix is to put the database in MIGRATION STAGE when migrating and block further migration requests.
no more exception
3