Skip to content

Commit

Permalink
online schema change: remove per-shard prompting
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Christensen committed May 4, 2017
1 parent 4e09824 commit 3fbbd4d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions plugins/online_schema_change/lib/topology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ def alter_table_shards(database, table, alter, dry_run=true, shard_pool=nil, ski

ui = PreflightShardUI.new(my_shards)
ui.run! do |shard,stage|
force_confirm_each_shard(shard) if stage == :all

# If we're past preflight, we want to not prompt the confirmation.
force = stage == :all
shard.alter_table(database, table, alter, dry_run, force, skip_rename, arbitrary_options)
Expand All @@ -30,7 +28,6 @@ def drop_old_alter_table_shards(database, table, shard_pool = nil)

ui = PreflightShardUI.new(my_shards)
ui.run! do |shard,_|
force_confirm_each_shard(shard) if stage == :all
shard.drop_old_alter_table(database, table)
end
end
Expand All @@ -41,18 +38,10 @@ def rename_table_shards(database, orig_table, copy_table, shard_pool=nil)

ui = PreflightShardUI.new(my_shards)
ui.run! do |shard,stage|
force_confirm_each_shard(shard) if stage == :all

# If we're past preflight, we want to not prompt the confirmation.
force = stage == :all
shard.rename_table(database, orig_table, copy_table, force)
end
end

def force_confirm_each_shard(shard)
while !agree("Continue on to #{shard.pool.to_s}? Not agreeing will leave the shard pool in an inconsistent state. (YES/no)")
output "It is non-sensical to stop now :( Please say yes, or Ctrl-C if you really mean it."
end
end
end
end

0 comments on commit 3fbbd4d

Please sign in to comment.