Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
5.5.46, 10.0.22, 10.1.8
-
None
-
Debian
Description
I recently experienced a slow MariaDB upgrade/migration from MySQL 5.5 to MariaDB 5.5, after the server has been stopped it took maybe one or two minutes before starting the new one.
A process doing a "chown mysql -R /var/lib/mysql" was runing for quite a long time.
This particular server has about 350000 files on its datadir, while its far from being the best practice its not easy to change that (its a shared hosting server).
Replacing the line on "mariadb-server-*.postinst" :
chown -R mysql $mysql_datadir
|
With something like (there is probably a better alternative) :
find /var/lib/mysql/ ! -uid $(id -u mysql) -print0 |xargs -0 -r chown mysql
|
It seems to be marginally slower (less than 1/100th of a second on my tests) on small directories but faster on directories with many files on it (about 20-40% faster on a directory with only 25k files on a software raid1 with 2* 7200k HDDs).