How can I instruct MySQL to complete all "in-progress" transactions, but to delay starting new ones (without kicking clients off) until I have taken a ZFS or LVM snapshot (which takes less than a second).
e.g.
- pause MySQL, waiting for "in-progress" transactions to complete
- sync to disk
- take ZFS/LVM snapshot
- resume MySQL The point of this is to get a consistent snapshot for backup purposes. Step 2 takes a fraction of a second.
Step one should not cause client errors, just a very short pause until step 4 is reached.
Are there MySQL commands which can do 1 and 4? What are they?