Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for pt-osc presence before running #8

Open
sauloperez opened this issue Aug 30, 2017 · 1 comment
Open

Check for pt-osc presence before running #8

sauloperez opened this issue Aug 30, 2017 · 1 comment

Comments

@sauloperez
Copy link

There's an edge case concerning create table and adding and index.

When you run a create table migration that includes an index creation from a machine that doesn't have percona-toolkit installed, the table will be created but the index will not, as the former doesn't go through pt-online-schema-change.

We should check it and raise a PerconaMigrator::CommandNotFoundError accordingly, before running a CREATE TABLE.

This also applies to any other DDL statements that don't go through pt-online-schema-change.

@jamesmacwilliam
Copy link

@sauloperez is this still an issue? When attempting to recreate, I tried the following:

create new migration:

-class CreateTableFoo < ActiveRecord::Migration[5.1]
    def change
      create_table :table_foos do |t|
        t.string :desc
        t.index :desc
      end
    end
  end

insert logging to departure/runner.rb

received the following sql:

CREATE TABLE `table_foos` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `desc` varchar(255),  INDEX `index_table_foos_on_desc`  (`desc`)) ENGIN
E=InnoDB

because there is no alter statement, the check for alter_statement? is not tripped and the regular sql runner is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants