<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="replica-sql-thread-states">
      </a>
      10.14.6 Replication SQL Thread States
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045221129840">
  </a>
  <a class="indexterm" name="idm46045221128352">
  </a>
  <p>
   The following list shows the most common states you may see in
        the
   <code class="literal">
    State
   </code>
   column for a replication SQL thread
        on a replica server.
  </p>
  <p>
   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
   <a class="link" href="replication-options-replica.html#sysvar_terminology_use_previous">
    <code class="literal">
     terminology_use_previous
    </code>
   </a>
   system
        variable to
   <code class="literal">
    BEFORE_8_0_26
   </code>
   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.
  </p>
  <p>
   Set the
   <a class="link" href="replication-options-replica.html#sysvar_terminology_use_previous">
    <code class="literal">
     terminology_use_previous
    </code>
   </a>
   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.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221119248">
      </a>
      <a class="indexterm" name="idm46045221117712">
      </a>
      <code class="literal">
       Making temporary file (append) before replaying
            LOAD DATA INFILE
      </code>
     </p>
     <p>
      The thread is executing a
      <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
       <code class="literal">
        LOAD
            DATA
       </code>
      </a>
      statement and is appending the data to a
            temporary file containing the data from which the replica
            reads rows.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221112864">
      </a>
      <a class="indexterm" name="idm46045221111328">
      </a>
      <code class="literal">
       Making temporary file (create) before replaying
            LOAD DATA INFILE
      </code>
     </p>
     <p>
      The thread is executing a
      <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
       <code class="literal">
        LOAD
            DATA
       </code>
      </a>
      statement and is creating a temporary file
            containing the data from which the replica reads rows. This
            state can only be encountered if the original
      <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
       <code class="literal">
        LOAD DATA
       </code>
      </a>
      statement was
            logged by a source running a version of MySQL lower than
            MySQL 5.0.3.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221105104">
      </a>
      <a class="indexterm" name="idm46045221103600">
      </a>
      <code class="literal">
       Reading event from the relay log
      </code>
     </p>
     <p>
      The thread has read an event from the relay log so that the
            event can be processed.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221100112">
      </a>
      <a class="indexterm" name="idm46045221098592">
      </a>
      <code class="literal">
       Slave has read all relay log; waiting for more
            updates
      </code>
     </p>
     <p>
      <a class="indexterm" name="idm46045221095952">
      </a>
      <a class="indexterm" name="idm46045221094416">
      </a>
      <code class="literal">
       Replica has read all relay log; waiting for more
            updates
      </code>
     </p>
     <p>
      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.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221090784">
      </a>
      <a class="indexterm" name="idm46045221089280">
      </a>
      <code class="literal">
       Waiting for an event from Coordinator
      </code>
     </p>
     <p>
      Using the multithreaded replica
            (
      <a class="link" href="replication-options-replica.html#sysvar_replica_parallel_workers">
       <code class="literal">
        replica_parallel_workers
       </code>
      </a>
      is greater than 1), one of the replica worker threads is
            waiting for an event from the coordinator thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221084432">
      </a>
      <a class="indexterm" name="idm46045221082928">
      </a>
      <code class="literal">
       Waiting for slave mutex on exit
      </code>
     </p>
     <p>
      <a class="indexterm" name="idm46045221080336">
      </a>
      <a class="indexterm" name="idm46045221078832">
      </a>
      <code class="literal">
       Waiting for replica mutex on exit
      </code>
     </p>
     <p>
      A very brief state that occurs as the thread is stopping.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221075376">
      </a>
      <a class="indexterm" name="idm46045221073856">
      </a>
      <code class="literal">
       Waiting for Slave Workers to free pending
            events
      </code>
     </p>
     <p>
      <a class="indexterm" name="idm46045221071216">
      </a>
      <a class="indexterm" name="idm46045221069696">
      </a>
      <code class="literal">
       Waiting for Replica Workers to free pending
            events
      </code>
     </p>
     <p>
      This waiting action occurs when the total size of events
            being processed by Workers exceeds the size of the
      <a class="link" href="replication-options-replica.html#sysvar_replica_pending_jobs_size_max">
       <code class="literal">
        replica_pending_jobs_size_max
       </code>
      </a>
      system variable. The Coordinator resumes scheduling when the
            size drops below this limit. This state occurs only when
      <a class="link" href="replication-options-replica.html#sysvar_replica_parallel_workers">
       <code class="literal">
        replica_parallel_workers
       </code>
      </a>
      is
            set greater than 0.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221063392">
      </a>
      <a class="indexterm" name="idm46045221061888">
      </a>
      <code class="literal">
       Waiting for the next event in relay log
      </code>
     </p>
     <p>
      The initial state before
      <code class="literal">
       Reading event from the
            relay log
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="indexterm" name="idm46045221057728">
      </a>
      <a class="indexterm" name="idm46045221056192">
      </a>
      <code class="literal">
       Waiting until SOURCE_DELAY seconds after source
            executed event
      </code>
     </p>
     <p>
      The SQL thread has read an event but is waiting for the
            replica delay to lapse. This delay is set with the
      <code class="literal">
       SOURCE_DELAY
      </code>
      option of the
      <a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
       <code class="literal">
        CHANGE REPLICATION SOURCE TO
       </code>
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <code class="literal">
    Info
   </code>
   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.
  </p>
 </div>
 <br/>
</div>
