Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
When there is a huge transaction in the undo log, the purge subsystem may get stuck and fail to shut down. This was reproduced with the following on MariaDB 10.4:
diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc
|
index 0e7ae8cf029..83e5387cdf4 100644
|
--- a/mysql-test/suite/innodb/include/innodb-page-compression.inc
|
+++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc
|
@@ -11,7 +11,7 @@ create table innodb_page_compressed9 (c1 int not null auto_increment primary key
|
|
--disable_query_log
|
begin;
|
-let $i = 2000;
|
+let $i = 5000;
|
while ($i)
|
{
|
insert into innodb_normal(b) values(REPEAT('Aa',50)); |
With this change, the attempt to restart the server would actually time out in the shutdown, like this:
10.4 |
innodb.innodb-page_compression_snappy 'innodb' [ fail ] Found warnings/errors in server log file!
|
Test ended at 2019-03-15 11:15:05
|
line
|
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 5 (user : '') did not exit
|
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 4 (user : '') did not exit
|
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 3 (user : '') did not exit
|
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 2 (user : '') did not exit
|
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 1 (user : '') did not exit
|
^ Found warnings in /dev/shm/10.4/mysql-test/var/log/mysqld.1.err
|
ok
|
The cause is that a purge thread would remain stuck in trx_purge_attach_undo_recs(). Apparently the innodb_purge_batch_size does not work correctly, or the n_pages_handled is not being incremented correctly. In any case, we should exit the loop on non-slow shutdown even before reaching the batch size.
Attachments
Issue Links
- relates to
-
MDEV-20158 innodb_zip.innochecksum failed in buildbot, server didn't shut down
- Closed
-
MDEV-18867 Long Time to Stop and Start
- Closed
-
MDEV-18952 CHECK TABLE should use READ UNCOMMITED if innodb_force_recovery>=5
- Closed