<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="replication-semisync-monitoring">
      </a>
      19.4.10.3 Semisynchronous Replication Monitoring
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045136141200">
  </a>
  <p>
   The plugins for semisynchronous replication expose a number of
        status variables that enable you to monitor their operation. To
        check the current values of the status variables, use
   <a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
    <code class="literal">
     SHOW STATUS
    </code>
   </a>
   :
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa19411006"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">STATUS</span> <span class="token operator">LIKE</span> <span class="token string">'Rpl_semi_sync%'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   All
   <code class="literal">
    Rpl_semi_sync_
    <em class="replaceable">
     <code>
      xxx
     </code>
    </em>
   </code>
   status variables are described at
   <a class="xref" href="server-status-variables.html" title="7.1.10 Server Status Variables">
    Section 7.1.10, “Server Status Variables”
   </a>
   . Some examples are:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_clients">
       <code class="literal">
        Rpl_semi_sync_source_clients
       </code>
      </a>
     </p>
     <p>
      The number of semisynchronous replicas that are connected to
            the source server.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
       <code class="literal">
        Rpl_semi_sync_source_status
       </code>
      </a>
     </p>
     <p>
      Whether semisynchronous replication currently is operational
            on the source server. The value is 1 if the plugin has been
            enabled and a commit acknowledgment has not occurred. It is
            0 if the plugin is not enabled or the source has fallen back
            to asynchronous replication due to commit acknowledgment
            timeout.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_tx">
       <code class="literal">
        Rpl_semi_sync_source_no_tx
       </code>
      </a>
     </p>
     <p>
      The number of commits that were not acknowledged
            successfully by a replica.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_yes_tx">
       <code class="literal">
        Rpl_semi_sync_source_yes_tx
       </code>
      </a>
     </p>
     <p>
      The number of commits that were acknowledged successfully by
            a replica.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_replica_status">
       <code class="literal">
        Rpl_semi_sync_replica_status
       </code>
      </a>
     </p>
     <p>
      Whether semisynchronous replication currently is operational
            on the replica. This is 1 if the plugin has been enabled and
            the replication I/O (receiver) thread is running, 0
            otherwise.
     </p>
    </li>
   </ul>
  </div>
  <p>
   When the source switches between asynchronous or semisynchronous
        replication due to commit-blocking timeout or a replica catching
        up, it sets the value of the
   <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
    <code class="literal">
     Rpl_semi_sync_source_status
    </code>
   </a>
   status variable appropriately. Automatic fallback from
        semisynchronous to asynchronous replication on the source means
        that it is possible for the
   <a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_enabled">
    <code class="literal">
     rpl_semi_sync_source_enabled
    </code>
   </a>
   system variable to have a value of 1 on the source side even
        when semisynchronous replication is in fact not operational at
        the moment. You can monitor the
   <a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
    <code class="literal">
     Rpl_semi_sync_source_status
    </code>
   </a>
   status variable to determine whether the source currently is
        using asynchronous or semisynchronous replication.
  </p>
 </div>
 <br/>
</div>
