[MDEV-12773] xtrabackup --prepare may hang with 'Waiting for 1 active transactions to finish' Created: 2017-05-10 Updated: 2017-08-17 Resolved: 2017-08-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, Storage Engine - InnoDB |
| Affects Version/s: | 10.2.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrii Nikitin (Inactive) | Assignee: | Andrii Nikitin (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | upstream | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
Xtrabackup 2.4.7 may hang in --prepare phase with MariaDB 10.2 in this test
The problem is not stable. Sometimes I can repeat it 1/10, sometimes it is 9/10 . There is consideration that the problem is incompatibility introduced by There is consideration that --prepare is not needed for simplest backup / restore scenario, and Server may be started directly on backup. |
| Comments |
| Comment by Andrii Nikitin (Inactive) [ 2017-05-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
data - actual data directory (it probably may differ from backup as server was still running and doing background activities) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-05-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I am able to repeat the hang with the latest xtrabackup 2.4 branch as follows:
So, there is one transaction with 15656 rows to roll back, which the main thread is waiting to be rolled back.
The reason why the checkpoint is hung is that the buf_flush_page_cleaner_coordinator thread already exited. I suspect that it is due to this condition:
The srv_shutdown_state == SRV_SHUTDOWN_CLEANUP fulfills the condition. I think that the page cleaner coordinator should stay around until the shutdown state has been moved beyond to SRV_SHUTDOWN_FLUSH_PHASE. That is what the code in MariaDB 10.2 is doing ever since the InnoDB code merge from MySQL 5.7.9:
This is also what Oracle MySQL 5.7 is doing ever since the condition was amended in May 2014. Related to this hang is the following bug that to my knowledge has not been fixed in MySQL or XtraBackup: It seems to me that the bogus condition that was introduced into xtrabackup may be trying to work around | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-05-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If I revert the one-liner Percona xtrabackup patch, the xtrabackup shutdown will not hang, but instead the recovered transaction will be rolled back:
(Note that in the gdb output of my previous comment, some rows were already rolled back; only 15656 remained to be rolled back.) I believe that even with this hang fixed, xtrabackup --prepare in 2.4 may work incorrectly with MariaDB 10.2.6 due to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-05-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've opened https://bugs.launchpad.net/percona-xtrabackup/+bug/1690333 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2017-08-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Fixed in 2.4.8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-08-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|