src/java/org/apache/cassandra/service/MigrationManager.java
/**
     * gets called during startup if we notice a mismatch between the current migration version and the one saved. This
     * can only happen as a result of the commit log recovering schema updates, which overwrites lastVersionId.
     * 
     * This method silently eats IOExceptions thrown by Migration.apply() as a result of applying a migration out of
     * order.
     */
gets called during startup if we notice a mismatch between the current migration version and the one saved. This
can only happen as a result of the commit log recovering schema updates, which overwrites lastVersionId.

This method silently eats IOExceptions thrown by Migration.apply() as a result of applying a migration out of
order.
gets called during startup if we notice a mismatch between the current migration version and the one saved . This can only happen as a result of the commit log recovering schema updates which overwrites lastVersionId . This method silently eats IOExceptions thrown by Migration . apply () as a result of applying a migration out of order .
public static void applyMigrations(final UUID from, final UUID to) throws IOException
    {
        List<Future<?>> updates = new ArrayList<Future<?>>();
        Collection<IColumn> migrations = Migration.getLocalMigrations(from, to);
        for (IColumn col : migrations)
        {
            final Migration migration = Migration.deserialize(col.value(), MessagingService.version_);
            Future<?> update = StageManager.getStage(Stage.MIGRATION).submit(new Runnable()
            {
                public void run()
                {
                    try
                    {
                        migration.apply();
                    }
                    catch (ConfigurationException ex)
                    {
                        logger.debug("Migration not applied " + ex.getMessage());
                    }
                    catch (IOException ex)
                    {
                        throw new RuntimeException(ex);
                    }
                }
            });
            updates.add(update);
        }
        for (Future<?> f : updates)
        {
            try
            {
                f.get();
            }
            catch (InterruptedException e)
            {
                throw new IOException(e);
            }
            catch (ExecutionException e)
            {
                throw new IOException(e);
            }
        }
        passiveAnnounce(to); 
    }
public static void applyMigrations ( final UUID from , final UUID to ) throws IOException { List < Future < ? > > updates = new ArrayList < Future < ? > > ( ) ; Collection < IColumn > migrations = Migration . getLocalMigrations ( from , to ) ; for ( IColumn col : migrations ) { final Migration migration = Migration . deserialize ( col . value ( ) , MessagingService . version_ ) ; Future < ? > update = StageManager . getStage ( Stage . MIGRATION ) . submit ( new Runnable ( ) { public void run ( ) { try { migration . apply ( ) ; } catch ( ConfigurationException ex ) { logger . debug ( "Migration not applied " + ex . getMessage ( ) ) ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } } } ) ; updates . add ( update ) ; } for ( Future < ? > f : updates ) { try { f . get ( ) ; } catch ( InterruptedException e ) { throw new IOException ( e ) ; } catch ( ExecutionException e ) { throw new IOException ( e ) ; } } passiveAnnounce ( to ) ; }
gets called during startup if we notice a mismatch between the current migration version and the one saved.
gets called during startup if we notice a mismatch between the current migration version and the one saved .
// assuming MessagingService.version_ is a bit of a risk, but you're playing with fire if you purposefully // take down a node to upgrade it during the middle of a schema update. // this happens if we try to apply something that's already been applied. ignore and proceed. // wait on all the updates before proceeding. // we don't need to send rpcs, but we need to update gossip