MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
  • MariaDB\ 71.8%
  • C++ 16.4%
  • C 10.4%
  • Shell 0.5%
  • Perl 0.4%
  • Other 0.3%
Find a file
Jan Lindström 50eb40a2a8 MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing
MDEV-11581: Mariadb starts InnoDB encryption threads
when key has not changed or data scrubbing turned off

Background: Key rotation is based on background threads
(innodb-encryption-threads) periodically going through
all tablespaces on fil_system. For each tablespace
current used key version is compared to max key age
(innodb-encryption-rotate-key-age). This process
naturally takes CPU. Similarly, in same time need for
scrubbing is investigated. Currently, key rotation
is fully supported on Amazon AWS key management plugin
only but InnoDB does not have knowledge what key
management plugin is used.

This patch re-purposes innodb-encryption-rotate-key-age=0
to disable key rotation and background data scrubbing.
All new tables are added to special list for key rotation
and key rotation is based on sending a event to
background encryption threads instead of using periodic
checking (i.e. timeout).

fil0fil.cc: Added functions fil_space_acquire_low()
to acquire a tablespace when it could be dropped concurrently.
This function is used from fil_space_acquire() or
fil_space_acquire_silent() that will not print
any messages if we try to acquire space that does not exist.
fil_space_release() to release a acquired tablespace.
fil_space_next() to iterate tablespaces in fil_system
using fil_space_acquire() and fil_space_release().
Similarly, fil_space_keyrotation_next() to iterate new
list fil_system->rotation_list where new tables.
are added if key rotation is disabled.
Removed unnecessary functions fil_get_first_space_safe()
fil_get_next_space_safe()

fil_node_open_file(): After page 0 is read read also
crypt_info if it is not yet read.

btr_scrub_lock_dict_func()
buf_page_check_corrupt()
buf_page_encrypt_before_write()
buf_merge_or_delete_for_page()
lock_print_info_all_transactions()
row_fts_psort_info_init()
row_truncate_table_for_mysql()
row_drop_table_for_mysql()
    Use fil_space_acquire()/release() to access fil_space_t.

buf_page_decrypt_after_read():
    Use fil_space_get_crypt_data() because at this point
    we might not yet have read page 0.

fil0crypt.cc/fil0fil.h: Lot of changes. Pass fil_space_t* directly
to functions needing it and store fil_space_t* to rotation state.
Use fil_space_acquire()/release() when iterating tablespaces
and removed unnecessary is_closing from fil_crypt_t. Use
fil_space_t::is_stopping() to detect when access to
tablespace should be stopped. Removed unnecessary
fil_space_get_crypt_data().

fil_space_create(): Inform key rotation that there could
be something to do if key rotation is disabled and new
table with encryption enabled is created.
Remove unnecessary functions fil_get_first_space_safe()
and fil_get_next_space_safe(). fil_space_acquire()
and fil_space_release() are used instead. Moved
fil_space_get_crypt_data() and fil_space_set_crypt_data()
to fil0crypt.cc.

fsp_header_init(): Acquire fil_space_t*, write crypt_data
and release space.

check_table_options()
	Renamed FIL_SPACE_ENCRYPTION_* TO FIL_ENCRYPTION_*

i_s.cc: Added ROTATING_OR_FLUSHING field to
information_schema.innodb_tablespace_encryption
to show current status of key rotation.
2017-03-14 16:23:10 +02:00
BUILD Correct FSF address 2017-03-10 18:21:29 +01:00
client Correct FSF address 2017-03-10 18:21:29 +01:00
cmake small plugin API related fixes 2017-03-10 18:21:28 +01:00
dbug MDEV-11752 Unsafe strmov - function definition in include/m_string.h 2017-03-10 18:21:29 +01:00
debian Correct FSF address 2017-03-10 18:21:29 +01:00
Docs Merge branch '10.0' into 10.0-galera 2016-04-29 16:50:58 -04:00
extra Fix InnoDB/XtraDB compilation warnings on 32-bit builds. 2017-03-09 08:54:07 +02:00
include Correct FSF address 2017-03-10 18:21:29 +01:00
libmysql small plugin API related fixes 2017-03-10 18:21:28 +01:00
libmysqld remove old API for SHA2 2017-03-10 18:21:27 +01:00
libservices Correct FSF address 2017-03-10 18:21:29 +01:00
man MDEV-11964 Add missing stub manpages 2017-03-10 11:15:28 +04:00
mysql-test MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing 2017-03-14 16:23:10 +02:00
mysys Correct FSF address 2017-03-10 18:21:29 +01:00
mysys_ssl remove old API for SHA2 2017-03-10 18:21:27 +01:00
pcre Merge 10.0 into 10.1 2017-03-09 08:53:08 +02:00
plugin Correct FSF address 2017-03-10 18:21:29 +01:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts MDEV-11941 - Lintian complains about executable bits 2017-03-07 22:28:33 +04:00
sql Fix truncation of affected rows and insert id in select_insert::send_ok_packet 2017-03-13 23:13:24 +00:00
sql-bench fix sql-bench test-table-elimination view leak. see MDEV-10310 for details 2016-07-12 22:21:49 +02:00
sql-common don't do vio_description(NULL) 2017-03-10 18:21:23 +01:00
storage MDEV-11738: Mariadb uses 100% of several of my 8 cpus doing nothing 2017-03-14 16:23:10 +02:00
strings Correct FSF address 2017-03-10 18:21:29 +01:00
support-files Merge 10.0 into 10.1 2017-03-09 08:53:08 +02:00
tests Merge 10.0 into 10.1 2017-03-09 08:53:08 +02:00
unittest Correct FSF address 2017-03-10 18:21:29 +01:00
vio Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
win Correct FSF address 2017-03-10 18:21:29 +01:00
wsrep Correct FSF address 2017-03-10 18:21:29 +01:00
zlib Backport from trunk: 2014-05-07 17:09:14 +02:00
.gitattributes Merge branch 'connect/10.1' into 10.1 2016-06-28 22:12:50 +02:00
.gitignore Post merge review fixes 2017-01-17 04:16:38 +02:00
BUILD-CMAKE various documentation updates 2012-06-18 16:57:58 -04:00
CMakeLists.txt Merge 10.0 into 10.1 2017-03-09 08:53:08 +02:00
config.h.cmake Merge 10.0 into 10.1 2017-03-09 08:53:08 +02:00
configure.cmake Merge tag 'mariadb-10.0.29' into 10.0-galera 2017-01-13 13:53:59 -05:00
COPYING Use a new version of "COPYING", the GPL text. 2010-03-04 14:26:27 +01:00
COPYING.LESSER MWL#192: non-blocking client API, after-review fixes. 2012-01-06 12:43:18 +01:00
COPYING.thirdparty Correct FSF address 2017-03-10 18:21:29 +01:00
CREDITS Update MariaDB Foundation sponsors 2017-02-28 17:15:36 +04:00
EXCEPTIONS-CLIENT MDEV-5645 MariaDB-5.5.35 - references are made to an "EXCEPTIONS-CLIENT" file but it does not exist 2014-05-31 13:18:56 +02:00
INSTALL-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
INSTALL-WIN-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
KNOWN_BUGS.txt various documentation updates 2012-06-18 16:57:58 -04:00
README Merge tag 'mariadb-10.0.24' into 10.0-galera 2016-02-23 20:53:29 -05:00
VERSION bump the VERSION 2017-03-14 09:56:05 -04:00

MariaDB is designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.

MariaDB is brought to you by the MariaDB Foundation.
Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who
now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
see the Credits appendix.  You can also run 'SHOW authors' to get a
list of active contributors.

A description of the MariaDB project and a manual can be found at:
http://mariadb.org/
https://mariadb.com/kb/en/
https://mariadb.com/kb/en/mariadb-vs-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

As MariaDB is a full replacement of MySQL, the MySQL manual at
http://dev.mysql.com/doc is generally applicable.

More help is available from the Maria Discuss mailing list
https://launchpad.net/~maria-discuss
and the #maria IRC channel on Freenode.

***************************************************************************

NOTE: 

MariaDB is specifically available only under version 2 of the GNU
General Public License (GPLv2). (I.e. Without the "any later version"
clause.) This is inherited from MySQL. Please see the README file in
the MySQL distribution for more information.

License information can be found in the COPYING, COPYING.LESSER,
and COPYING.thirdparty files.

***************************************************************************

IMPORTANT:

Bug and/or error reports regarding MariaDB should be submitted at
http://mariadb.org/jira

Bugs in the MySQL code can also be submitted at http://bugs.mysql.com

The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server

***************************************************************************