facebookincubator/OnlineSchemaChange

Wrong max_wait_for_slow_query deafults

Closed this issue · 0 comments

When not provided in the command line, the --max-wait-for-slow-query will be attributed the value None, breaking the execution.

$ osc_cli copy --mysql-user=root --mysql-password="" --ddl-file-list=/tmp/test2-new.sql --socket=/var/lib/mysql/mysql.sock --database=test
...
Traceback (most recent call last):
  File "/home/apahim/git/OnlineSchemaChange/core/lib/payload/copy.py", line 2339, in run_ddl
    self.create_triggers()
  File "/home/apahim/git/OnlineSchemaChange/core/lib/hook.py", line 42, in func_with_hook
    result = func(self, *args, **kwargs)
  File "/home/apahim/git/OnlineSchemaChange/core/lib/payload/copy.py", line 1237, in create_triggers
    self.wait_until_slow_query_finish()
  File "/home/apahim/git/OnlineSchemaChange/core/lib/payload/copy.py", line 1046, in wait_until_slow_query_finish
    for _ in range(self.max_wait_for_slow_query):
TypeError: range() integer end argument expected, got NoneType.

...