Description:
Online backup introduced a separate timeout value, called backup_wait_timeout. Unfortunately, it behaves differently from the rest of the timeout values that we have, such as table-wait-timeout or innodb-lock-wait-timeout:
* The value is per-session, and it is not possible to set a server-wide default.
* A timeout results in all queries that block BACKUP to be terminated, and not BACKUP itself. This is contrary to the behavior of stuff such as ALTER TABLE, which times out by itself, but never causes other, DML queries to be terminated. This also means that the error is delivered to the database application that is issuing transactions against the database, and not to any backup management software, which would be the piece of code best prepared to handle it.
* The error has a new code , 1749 that is not used outside backup. A new timeout code means that all existing client applications that attempt to handle and respond to deadlock situations will need to be adjusted to account for that extra code; It would not be possible to add backup to an existing database application without modifying it.
* The error name ER_DDL_TIMEOUT is misleading, since this error is only used for backup;
* The error message contains the entire text of the query that is being terminated, which is never the case with any of the other error messages.
How to repeat:
Grep code for ER_DDL_TIMEOUT
Suggested fix:
* Completely abandon this new timeout value and error code and reuse existing options and/or codes, if possible integrated with MDL locking;
* Make the feature behave as would any DDL statement, e.g. ALTER TABLE;
* If the backup timeout value and error need to remain, bring them in line with the behavior of the rest of the timeout values and errors;