
relocked before FLUSH TABLES returns. This allows one to copy the table after
FLUSH TABLES returns without having any writes on the table. For now this
works works with most tables, except InnoDB as InnoDB may do background purges
on the table even while it's write locked.

Purpose of FLUSH TABLES table_list WITH READ LOCK
-------------------------------------------------

FLUSH TABLES table_list WITH READ LOCK should work as FLUSH TABLES WITH READ
LOCK, but only those tables that are listed will be properly closed. However
in practice this works exactly like FLUSH TABLES WITH READ LOCK as the FLUSH
command has anyway to wait for all WRITE operations to end because we are
depending on a global read lock for this code. In the future we should
consider fixing this to instead use meta data locks.

Implementation of FLUSH TABLES commands from MariaDB 10.4.8
-----------------------------------------------------------

Implementation of FLUSH TABLES
------------------------------

* Free memory and file descriptors not in use

Implementation of FLUSH TABLES WITH READ LOCK
---------------------------------------------

* Lock all tables read only for simple old style backup.
* All background writes are suspended and tables are marked as closed.
* No statement requiring table changes are allowed for any user until UNLOCK
TABLES.

Instead of using FLUSH TABLE WITH READ LOCK one should in most cases instead
use BACKUP STAGE BLOCK_COMMIT.

Implementation of FLUSH TABLES table_list
-----------------------------------------

* Free memory and file descriptors for tables not in use from table list.
* Lock given tables as read only.
* Wait until all translations has ended that uses any of the given tables.
* Wait until all background writes are suspended and tables are marked as
closed.

Implementation of FLUSH TABLES table_list FOR EXPORT
----------------------------------------------------

* Free memory and file descriptors for tables not in use from table list
* Lock given tables as read.
* Wait until all background writes are suspended and tables are marked as
closed.
* Check that all tables supports FOR EXPORT
* No changes to these tables allowed until UNLOCK TABLES

This is basically the same behavior as in old MariaDB version if one first
lock the tables, then do FLUSH TABLES. The tables will be copyable until

FLUSH SSL
---------

In MariaDB 10.4 and later, the FLUSH SSL command can be used to dynamically
reinitialize the server's TLS context. This is most useful if you need to
replace a certificate that is about to expire without restarting the server.

This operation is performed by reloading the files defined by the following
TLS system variables:

* ssl_cert
* ssl_key
* ssl_ca
* ssl_capath
* ssl_crl
* ssl_crlpath

These TLS system variables are not dynamic, so their values can not be changed
without restarting the server.

If you want to dynamically reinitialize the server's TLS context, then you
need to change the certificate and key files at the relevant paths defined by
these TLS system variables, without actually changing the values of the
variables. See MDEV-19341 for more information.

Reducing Memory Usage
---------------------

To flush some of the global caches that take up memory, you could execute the
following command:

FLUSH LOCAL HOSTS,
 QUERY CACHE,
 TABLE_STATISTICS,
 INDEX_STATISTICS,
 USER_STATISTICS;

URL: https://mariadb.com/kb/en/flush/