mirror of https://github.com/apache/cassandra
Migrate key_alias->key_aliases on every schema migration (1.2)
Another follow-up to 5800
This commit is contained in:
parent
2d2099751c
commit
82081c7b4b
|
|
@ -341,6 +341,10 @@ public class DefsTable
|
|||
for (RowMutation mutation : mutations)
|
||||
mutation.apply();
|
||||
|
||||
// Must be called after each schema pull and not just on startup to guarantee the migration.
|
||||
// See CASSANDRA-5800 comments for the details.
|
||||
SystemTable.migrateKeyAlias();
|
||||
|
||||
if (!StorageService.instance.isClientMode())
|
||||
flushSchemaCFs();
|
||||
|
||||
|
|
|
|||
|
|
@ -184,11 +184,10 @@ public class SystemTable
|
|||
migrateKeyAlias();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 1.1 used a key_alias column; 1.2 changed that to key_aliases as part of CQL3
|
||||
*/
|
||||
private static void migrateKeyAlias()
|
||||
public static void migrateKeyAlias()
|
||||
{
|
||||
String selectQuery = String.format("SELECT keyspace_name, columnfamily_name, writetime(type), key_aliases, key_alias FROM %s.%s",
|
||||
Table.SYSTEM_KS,
|
||||
|
|
|
|||
Loading…
Reference in New Issue