Slave SQL thread-opracowanie

Nasza ocena:

3
Wyświetleń: 868
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Slave SQL thread-opracowanie - strona 1

Fragment notatki:

Slave SQL thread. The slave creates an SQL thread to read the relay log that is written by the
slave I/O thread and execute the events contained therein.
In the preceding description, there are three threads per master/slave connection. A master that has
multiple slaves creates one binlog dump thread for each currently connected slave, and each slave has
its own I/O and SQL threads.
A slave uses two threads to separate reading updates from the master and executing them into
independent tasks. Thus, the task of reading statements is not slowed down if statement execution
is slow. For example, if the slave server has not been running for a while, its I/O thread can quickly
fetch all the binary log contents from the master when the slave starts, even if the SQL thread lags
far behind. If the slave stops before the SQL thread has executed all the fetched statements, the I/
O thread has at least fetched everything so that a safe copy of the statements is stored locally in the
slave's relay logs, ready for execution the next time that the slave starts. This enables the master
server to purge its binary logs sooner because it no longer needs to wait for the slave to fetch their
contents.
The SHOW PROCESSLIST statement provides information that tells you what is happening on the
master and on the slave regarding replication. For information on master states, see Section 8.12.5.5,
“Replication Master Thread States”. For slave states, see Section 8.12.5.6, “Replication Slave I/O
Thread States”, and Section 8.12.5.7, “Replication Slave SQL Thread States”.
The following example illustrates how the three threads show up in the output from SHOW
PROCESSLIST.
... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz