[MDEV-10198] MariaDB restart is too slow Created: 2016-06-09  Updated: 2017-04-27  Resolved: 2016-09-22

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1.14
Fix Version/s: 10.1.18

Type: Bug Priority: Major
Reporter: Darshit Gavhane Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 1
Labels: innodb, mariadb-restart
Environment:

OS: centos-release-6-6.el6.centos.12.2.x86_64
Architecture: x86_64
Hardware: vcpu-4, memory-15GiB


Issue Links:
Blocks
is blocked by MDEV-9931 InnoDB reads first page of every .ibd... Closed
Relates
relates to MDEV-12610 MariaDB start is slow Closed

 Description   

The size of our data is around 200 - 300G and 4703 tables. After restart, on doing strace we can see that it scans all the .ibd files nearly 200000 files and takes about 10 mins to start.

160608 02:11:45 mysqld_safe Starting mysqld daemon with databases from /path/to/mysql/data
2016-06-08  2:11:46 139989491841056 [Warning] option 'general_log': boolean value '/path/to/log/mysqld.log' wasn't recognized. Set to OFF.
2016-06-08  2:11:46 139989491841056 [Note] /usr/libexec/mysqld (mysqld 10.1.14-MariaDB) starting as process 10933 ...
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: The InnoDB memory heap is disabled
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Memory barrier is not used
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Using Linux native AIO
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Using SSE crc32 instructions
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Initializing buffer pool, size = 2.0G
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Completed initialization of buffer pool
2016-06-08  2:11:46 139989491841056 [Note] InnoDB: Highest supported file format is Barracuda.
2016-06-08  2:22:38 139989491841056 [Note] InnoDB: 128 rollback segment(s) are active.
2016-06-08  2:22:38 139989491841056 [Note] InnoDB: Waiting for purge to start
2016-06-08  2:22:39 139989491841056 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.29-76.2 started; log sequence number 21147217244291
2016-06-08  2:22:39 139986282186496 [Note] InnoDB: Dumping buffer pool(s) not yet started
2016-06-08  2:22:39 139989491841056 [Note] Plugin 'FEEDBACK' is disabled.
2016-06-08  2:22:39 139989491841056 [Note] Server socket created on IP: '::'.
2016-06-08  2:22:39 139989491841056 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.1.14-MariaDB'  socket: '/path/to/mysql.sock'  port: 3306  MariaDB Server



 Comments   
Comment by Elena Stepanova [ 2016-06-09 ]

The reason of the problem is almost certainly MDEV-9931.

Comment by Jan Lindström (Inactive) [ 2016-09-22 ]

commit 2bedc3978b90bf5abe1029df393c63ced1849bed
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Thu Sep 22 16:32:26 2016 +0300
MDEV-9931: InnoDB reads first page of every .ibd file at startup
Analysis: By design InnoDB was reading first page of every .ibd file
at startup to find out is tablespace encrypted or not. This is
because tablespace could have been encrypted always, not
encrypted newer or encrypted based on configuration and this
information can be find realible only from first page of .ibd file.
Fix: Do not read first page of every .ibd file at startup. Instead
whenever tablespace is first time accedded we will read the first
page to find necessary information about tablespace encryption
status.
TODO: Add support for SYS_TABLEOPTIONS where all table options
encryption information included will be stored.

Generated at Thu Feb 08 07:40:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.