Bug #75995 mysqld --help --verbose tries to lock files
Submitted: 22 Feb 2015 11:01 Modified: 2 Jul 2015 16:20
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.7.6-m16 OS:Any
Assigned to: CPU Architecture:Any

[22 Feb 2015 11:01] Daniël van Eeden
Description:
mysqld tries to lock ibdata1 when running "mysqld --help --verbose"

How to repeat:
This only happens when the server is running.

./mysqld --help --verbose
2015-02-22T10:51:49.838900Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-22T10:51:50.839127Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
* many more lines with the same error *
2015-02-22T10:53:28.861858Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-22T10:53:29.862030Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11
2015-02-22T10:53:29.862107Z 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2015-02-22T10:53:29.862150Z 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'.
2015-02-22T10:53:29.862173Z 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2015-02-22T10:53:29.862195Z 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-02-22T10:53:30.462894Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2015-02-22T10:53:30.462951Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-02-22T10:53:30.462976Z 0 [ERROR] Failed to initialize plugins.
* regular --help --verbose output *
Plugins have parameters that are not reflected in this list
because execution stopped before plugins were initialized.

To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.
2015-02-22T10:53:30.481309Z 0 [ERROR] Aborting

Suggested fix:
Don't lock anything when running '--help'

Related:

Bug #30025 	Mysqld prints out warnings/errors being run with --no-defaults --help
Bug #31106 	errors whenn running "mysqld --help" before "mysql_install_db"
Bug #62752 	mysqld --verbose --help ends with error
Bug #71599 	Unexpected log output for mysqld --help --verbose
[22 Feb 2015 11:04] Daniël van Eeden
This can be a server issue or an InnoDB issue.
[22 Feb 2015 12:23] MySQL Verification Team
Thank you for the bug report.
[11 Mar 2015 11:30] Ståle Deraas
Posted by developer:
 
In the work to move system tables from MyISAM to InnoDB, information about plugins now have to be looked up in an InnoDB table. The way --help --verbose is implemented, is not optimal wrt to performance, but will require quite a major effort to improve. Short term, at least, we do not plan to fix this.
[2 Jul 2015 16:20] Paul DuBois
Noted in 5.7.8, 5.8.0 changelogs.

mysqld --help --verbose tried to perform actions that have nothing to
do with displaying a help message: Locking files, initializing system
files, and checking for a plugin table.