下面的列表显示了在副本服务器上,复制 SQL 线程的 State 列中您可能看到的最常见状态。The following list shows the most common states you may see in
the State column for a replication SQL thread
on a replica server.
在 MySQL 8.0 中,对监控指标名称进行了不兼容的更改。使用这些监控指标名称的监控工具可能会受到影响。如果这些不兼容的更改对您有影响,请将 terminology_use_previous 系统变量设置为 BEFORE_8_0_26,以使 MySQL 服务器使用前面列表中指定对象的旧名称版本。这可以使依赖旧名称的监控工具继续工作,直到它们可以更新以使用新名称为止。In MySQL 8.0, incompatible changes were made to instrumentation
names. Monitoring tools that work with these instrumentation
names might be impacted. If the incompatible changes have an
impact for you, set the
terminology_use_previous system
variable to BEFORE_8_0_26 to make MySQL
Server use the old versions of the names for the objects
specified in the previous list. This enables monitoring tools
that rely on the old names to continue working until they can be
updated to use the new names.
将 terminology_use_previous 系统变量设置为会话范围以支持单独函数,或设置为全局范围以作为所有新会话的默认值。当使用全局范围时,慢查询日志包含名称的旧版本。Set the
terminology_use_previous system
variable with session scope to support individual functions, or
global scope to be a default for all new sessions. When global
scope is used, the slow query log contains the old versions of
the names.
Making temporary file (append) before replaying LOAD DATA INFILEMaking temporary file (append) before replaying LOAD DATA INFILE线程正在执行一个
LOAD DATA语句,并将数据追加到一个临时文件中,该文件包含副本读取行的数据。The thread is executing aLOAD DATAstatement and is appending the data to a temporary file containing the data from which the replica reads rows.Making temporary file (create) before replaying LOAD DATA INFILEMaking temporary file (create) before replaying LOAD DATA INFILE线程正在执行一个
LOAD DATA语句,并创建一个临时文件,其中包含副本读取行的数据。只有当原始LOAD DATA语句由运行版本低于 MySQL 5.0.3 的源记录时,才会遇到这种状态。The thread is executing aLOAD DATAstatement and is creating a temporary file containing the data from which the replica reads rows. This state can only be encountered if the originalLOAD DATAstatement was logged by a source running a version of MySQL lower than MySQL 5.0.3.Reading event from the relay logReading event from the relay log该线程已经从中继日志中读取了一个事件,以便可以处理该事件。The thread has read an event from the relay log so that the event can be processed.
Slave has read all relay log; waiting for more updatesSlave has read all relay log; waiting for more updatesReplica has read all relay log; waiting for more updatesReplica has read all relay log; waiting for more updates该线程已处理完中继日志文件中的所有事件,现在正在等待 I/O(接收)线程将新事件写入中继日志。The thread has processed all events in the relay log files, and is now waiting for the I/O (receiver) thread to write new events to the relay log.
Waiting for an event from CoordinatorWaiting for an event from Coordinator使用多线程副本(
replica_parallel_workers大于 1 时),其中一个副本工作线程正在等待协调器线程的事件。Using the multithreaded replica (replica_parallel_workersis greater than 1), one of the replica worker threads is waiting for an event from the coordinator thread.Waiting for slave mutex on exitWaiting for slave mutex on exitWaiting for replica mutex on exitWaiting for replica mutex on exit在线程停止时发生的非常短暂的状态。A very brief state that occurs as the thread is stopping.
Waiting for Slave Workers to free pending eventsWaiting for Slave Workers to free pending eventsWaiting for Replica Workers to free pending eventsWaiting for Replica Workers to free pending events当工作线程正在处理的事件总大小超过系统变量
replica_pending_jobs_size_max的大小时,会发生这种等待操作。当大小降到此限制以下时,协调器会恢复调度。仅当replica_parallel_workers设置大于 0 时,才会出现这种状态。This waiting action occurs when the total size of events being processed by Workers exceeds the size of thereplica_pending_jobs_size_maxsystem variable. The Coordinator resumes scheduling when the size drops below this limit. This state occurs only whenreplica_parallel_workersis set greater than 0.Waiting for the next event in relay logWaiting for the next event in relay log在
Reading event from the relay log之前的初始状态。The initial state beforeReading event from the relay log.Waiting until SOURCE_DELAY seconds after source executed eventWaiting until SOURCE_DELAY seconds after source executed eventSQL 线程已经读取了一个事件,但正在等待副本延迟过期。此延迟通过
CHANGE REPLICATION SOURCE TO的SOURCE_DELAY选项设置。The SQL thread has read an event but is waiting for the replica delay to lapse. This delay is set with theSOURCE_DELAYoption of theCHANGE REPLICATION SOURCE TO.
SQL 线程的 Info 列也可能显示语句的文本。这表明线程已经从中继日志中读取了一个事件,从中提取了语句,并可能正在执行它。The Info column for the SQL thread may also
show the text of a statement. This indicates that the thread has
read an event from the relay log, extracted the statement from
it, and may be executing it.