In this post I would like to review how my dumper for MySQL works from the point of view of locks. Since 0.6 serie we have different options, so I will try to explain how they work
As you may know mydumper is multithreaded and this adds a lot of complexity compared with other logical backup tools as it also needs to coordinate all threads with the same snapshot to be consistent. So let review how mydumper does this with the default settings.
By default mydumper uses 4 threads to dump data and 1 main thread
Main Thread
- FLUSH TABLES WITH READ LOCK
Dump Thread X
- START TRANSACTION WITH CONSISTENT SNAPSHOT;
- dump non-InnoDB tables
Main Thread
- UNLOCK TABLES
Dump Thread X
- dump InnoDB tables
As you can see in this case we need FTWRL for two things, coordinate transaction’s snapshots …
[Read more]