Ignore "enforce_storage_engine" option on "mysql" and "performance_schema" databases

Bug #1218664 reported by Bob Test
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Hrvoje Matijakovic
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
Medium
Hrvoje Matijakovic
5.6
Fix Released
Medium
Hrvoje Matijakovic

Bug Description

Hi,

The "enforce_storage_engine" option should be ignored on MySQL's internal databases "mysql" and "performance_schema".
The tables in "mysql" database should always use MyISAM storage engine, except for "general_log" and "slow_log" tables which uses CSV engine. The tables of "performance_schema" database should always use PERFORMANCE_SCHEMA engine.

If not, when "mysql_upgrade" is launched after an upgrade, the engine of mysql database tables will be forced to InnoDB which cause server crash on next restart :

130829 23:48:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/data/
130829 23:48:04 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
130829 23:48:04 [Note] Plugin 'FEDERATED' is disabled.
21:48:04 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=0
max_threads=502
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1131292 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7e9b8036d5b0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7e9b8036d080 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x7cd76e]
/usr/sbin/mysqld(handle_fatal_signal+0x491)[0x6b59a1]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf030)[0x6fa922bbb030]
/usr/sbin/mysqld(_Z18ha_resolve_by_nameP3THDPK19st_mysql_lex_string+0x79)[0x6b72f9]
/usr/sbin/mysqld(_Z14open_table_defP3THDP11TABLE_SHAREj+0x1545)[0x63ec95]
/usr/sbin/mysqld(_Z15get_table_shareP3THDP10TABLE_LISTPcjjPij+0x1a1)[0x582f01]
/usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP18Open_table_context+0x3e7)[0x589597]
/usr/sbin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x4f9)[0x58a569]
/usr/sbin/mysqld(_Z20open_and_lock_tablesP3THDP10TABLE_LISTbjP19Prelocking_strategy+0x47)[0x58b0a7]
/usr/sbin/mysqld[0x5caa30]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x9cb)[0x5cd86b]
/usr/sbin/mysqld[0x54fd9a]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x457)[0x550ad7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x6fa921736ead]
/usr/sbin/mysqld[0x54711d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 0
Status: NOT_KILLED

You may download the Percona Server operations manual by visiting
http://www.percona.com/software/percona-server/. You may find information
in the manual which will help you identify the cause of the crash.
130829 23:48:04 mysqld_safe mysqld from pid file /var/lib/mysql/mysql.pid ended

Tags: doc

Related branches

Revision history for this message
Bob Test (bobtest000-deactivatedaccount) wrote :

"[...] engine of mysql database tables will be forced to InnoDB [...]"

...if "enforce_storage_engine" is set to "InnoDB", obviously.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

George -

Can you investigate?

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

As a side note, in MySQL (and PS) 5.6 it is expected to see some InnoDB tables in mysql database.

tags: added: 56qual
tags: removed: 56qual
tags: added: 56qual
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

So I am thinking that maybe another option should be added --enforce-storage-engine-skip which would be a list of databases that the enforcement would not apply to. The default value would be "mysql;performance_schema;INFORMATION_SCHEMA;PERCONA_SCHEMA"

Thoughts?

Revision history for this message
Roel Van de Paar (roel11) wrote :

George, I like that approach, not limiting yet ensuring good operation.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

I am not sure I am convinced that a globally-applying --enforce-storage-engine-skip with a default value is the best way to go. It makes an actual use of this option complicated because of the need to list all the system schemas every time and allows to shoot ourselves in the foot by specifying a value that misses some of the system schemas, which is never a valid option, isn't it?

I'd propose
- to fix this bug by ignoring enforce-storage-engine on system schemas by default, silently, no option exposed;
- to log a separate feature request for --enforce-storage-engine-skip that only concerns with user schemas.

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

As discussed on IRC and merge comments:

The core problem is that the enforcement is being applied at times when it shouldn't, i.e. when system tables are being ALTERED. The only time system tables should be CREATED or ALTERED is either during initial db install or upgrade. Selective filtering based on various info bits such as schema name or table category all introduce different complications and result in a less secure feature or leave the core issue remaining. The correct way to handle this is to disable enforcement during bootstrapping and upgrade times. Since mysql_upgrade generally must be called with --skip-grant-tables, we will disable enforcement any time --bootstrap or --skip-grants-tables is used.

Revision history for this message
Bob Test (bobtest000-deactivatedaccount) wrote :

Under Debian mysql_upgrade is launched by /etc/mysql/debian-start script, who is called after each server start.
So, at least under Debian, mysql_upgrade is run without --skip-grants-tables option.

Revision history for this message
Roel Van de Paar (roel11) wrote :

5.5. affected also, so not 56qual

tags: removed: 56qual
Revision history for this message
George Ormond Lorch III (gl-az) wrote :

As discussed via IRC and email. This is going to be a doc issue for now. If using enforce-storage-engine, you must either disable it before doing mysql_upgrade or perform mysql_upgrade with server started with --skip-grants-tables after bug 1236938 has been merged.

tags: added: doc
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-125

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-124

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.