From cb4048a2e0dee1614fd55bb26d9add5e353148c1 Mon Sep 17 00:00:00 2001 From: frank-cizmich Date: Wed, 13 May 2015 14:31:43 -0300 Subject: [PATCH] pt-osc: added --sleep option. Useful when load or lag checking is not possible --- bin/pt-online-schema-change | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index ead42cfd..2e3981fa 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -9260,6 +9260,12 @@ sub main { $sys_load_pr->start() if $sys_load_pr; $sys_load->wait(Progress => $sys_load_pr); + # sleep between chunks to avoid overloading PXC nodes + my $sleep = $args{NibbleIterator}->{OptionParser}->get('sleep'); + if ( $sleep ) { + sleep $sleep; + } + return; }, done => sub { @@ -11495,6 +11501,15 @@ value of C<10000>. The tool prints a warning and continues if a variable cannot be set. +=item --sleep + +type: float; default: 0 + +How long to sleep (in seconds) after copying each chunk. This option is useful +when throttling by L<"--max-lag"> and L<"--max-load"> are not possible. +A small, sub-second value should be used, like 0.1, else the tool could take +a very long time to copy large tables. + =item --socket short form: -S; type: string