Outdated Version
You are viewing an older version of this section. View current production version.
FLUSH TABLES
Read lock all tables across all databases and make all other MemSQL connections block when they try to modify these tables.
Syntax
FLUSH TABLES WITH READ LOCK
Remarks
FLUSH TABLES
will lock and then flush all remaining write transactions in the current database to disk.- You need to
UNLOCK TABLES
before you can modify or write to tables locked by this command in the current MemSQL database. RunningUNLOCK TABLES
afterFLUSH TABLES..
will make the cluster available for writes. RunningUNLOCK TABLES
afterFLUSH TABLES WITH READ LOCK
, specifically, will also unblock any writes that were initiated afterFLUSH TABLES WITH READ LOCK
was submitted. TheUNLOCK TABLES
query must be run in the same connection as theFLUSH TABLES
query for this feature to take effect. - This command must be run on the master aggregator node or a child aggregator node (see Node Requirements for MemSQL Commands ).
Example
memsql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
Related Topics