| Bug #93865 | innodb_online_alter_log_max_size - Inconsistency about transactions rollback | ||
|---|---|---|---|
| Submitted: | 9 Jan 2019 18:04 | Modified: | 10 Feb 2019 13:56 |
| Reporter: | Vinicius Malvestio Grippa | Email Updates: | |
| Status: | No Feedback | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.6, 5.7, 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[9 Jan 2019 18:04]
Vinicius Malvestio Grippa
[9 Jan 2019 18:13]
Vinicius Malvestio Grippa
To make it more clear:
Open DML(started after the DDL) will be holding Metadata Lock on the said table, it won't rollback open transactions, and the error on DDL will only be seen when concurrent DML's either commit or rollback making it impossible to reach `all uncommitted concurrent DML operations are rolled back.` stated in the documentation.
Session 1
master [localhost] {msandbox} (test) > alter table joinit drop column test1;
Session 2
master [localhost] {msandbox} (test) > start transaction; update joinit set s = 'test7' limit 1000000;
Query OK, 0 rows affected (0.00 sec)
Query OK, 1000000 rows affected (24.25 sec)
Rows matched: 1000000 Changed: 1000000 Warnings: 0
Session 3
master [localhost] {msandbox} (test) > show processlist;
+----+----------+-----------------+------+-------------+------+---------------------------------------------------------------+--------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+----------+-----------------+------+-------------+------+---------------------------------------------------------------+--------------------------------------+
| 4 | rsandbox | localhost:33426 | NULL | Binlog Dump | 8507 | Master has sent all binlog to slave; waiting for more updates | NULL |
| 5 | rsandbox | localhost:33428 | NULL | Binlog Dump | 8507 | Master has sent all binlog to slave; waiting for more updates | NULL |
| 6 | msandbox | localhost | test | Query | 117 | Waiting for table metadata lock | alter table joinit drop column test1 |
| 11 | msandbox | localhost | test | Sleep | 1671 | | NULL |
| 20 | msandbox | localhost | NULL | Sleep | 1680 | | NULL |
| 21 | msandbox | localhost | test |
Query | 0 | starting | show processlist |
| 22 | msandbox | localhost | test | Sleep | 114 | | NULL |
+----+----------+-----------------+------+-------------+------+---------------------------------------------------------------+----------
COMMIT:
Session 2
master [localhost] {msandbox} (test) > commit;
Query OK, 0 rows affected (0.37 sec)
Session 1
master [localhost] {msandbox} (test) > alter table joinit drop column test1; ERROR 1799 (HY000): Creating index 'PRIMARY' required more than 'innodb_online_alter_log_max_size' bytes of modification log. Please try again.
No rollbacks have been made.
[10 Jan 2019 13:56]
MySQL Verification Team
Hi, Thank you for your documentation bug report. However, I have a few questions regarding your examples of the bad documentation. First case: When the certain file size exceeds its limit, the ALTER fails and all uncommitted CONCURRENT DMLs are rolled back. However, in your example, you do not have a concurrent DML. You clearly write that session 2 starts after session 1. Hence, this does not prove documentation to be wrong. Second case: Holding MDLs does not imply that other DMLs on that table should be rolled back. They will just wait for the MDL, if and when it is required. Third case: In your second example, there is this output: Query OK, 1000000 rows affected (24.25 sec) Rows matched: 1000000 Changed: 1000000 Warnings: 0 Does it come from the session 1 or session 2. In any case, both transactions are successful, so I do not see a point regarding documentation mistake. Fourth case: You show a processlist with only one relevant transaction, which is alter table. So, there are no concurrent DMLs, so again I can't see a point. Related to this example, when DDL finally fails, there are no concurrent DMLs running, so there is nothing to roll back.
[11 Feb 2019 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
