Replication Threads

You are viewing an old version of this article. View the current version here.

MariaDB's replication implementation requires several types of threads.

Threads on the Master

The master only has one type of replication-related thread: binary log dump thread.

Binary Log Dump Thread

The binary log dump thread runs on the master and dumps the binary log to the slave. In SHOW PROCESSLIST output, this thread is identified by Binlog Dump.

Threads on the Slave

The master has three types of replication-related threads: the slave I/O thread, the slave SQL thread, and worker threads, which are only applicable when parallel replication is in use.

Slave I/O Thread

The slave's I/O thread receives the binary log events from the master and writes them to its relay log.

Slave SQL Thread

The slave's SQL thread reads events from the relay log. What it does with them depends on whether parallel replication is in use. If parallel replication is not in use, then the SQL thread applies the events to its local copy of the data. If parallel replication is in use, then the SQL thread hands off the events to its worker threads to apply in parallel.

Worker Threads

When parallel replication is in use, then the SQL thread hands off the events to its worker threads to apply in parallel.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.