<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="replication-mode-change-online-verify-transactions">
      </a>
      19.1.4.4 Verifying Replication of Anonymous Transactions
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045145348640">
  </a>
  <p>
   This section explains how to monitor a replication topology and
      verify that all anonymous transactions have been replicated. This
      is helpful when changing the replication mode online as you can
      verify that it is safe to change to GTID transactions.
  </p>
  <p>
   There are several possible ways to wait for transactions to
      replicate:
  </p>
  <p>
   The simplest method, which works regardless of your topology but
      relies on timing is as follows: If you are sure that the replica
      never lags more than
   <em class="replaceable">
    <code>
     N
    </code>
   </em>
   seconds, wait
      any period of time that is longer than
   <em class="replaceable">
    <code>
     N
    </code>
   </em>
   seconds, which you consider safe for
      your deployment.
  </p>
  <p>
   A safer method, in the sense that it does not depend on timing, if
      you only have a source with one or more replicas, is to perform
      the following two steps:
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      On the source, execute this statement:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa35020352"><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 keyword">SHOW</span> <span class="token datatype">BINARY</span> LOG <span class="token keyword">STATUS</span><span class="token punctuation">;</span></code></pre>
     </div>
     <p>
      Make a note of the values displayed in the
      <code class="literal">
       File
      </code>
      and
      <code class="literal">
       Position
      </code>
      columns of the output.
     </p>
    </li>
    <li class="listitem">
     <p>
      On each replica, use the file and position information from
          the source to perform the statement shown here:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa4546577"><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 keyword">SELECT</span> SOURCE_POS_WAIT<span class="token punctuation">(</span><span class="token keyword"><em class="replaceable">file</em></span><span class="token punctuation">,</span> <em class="replaceable">position</em><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
   </ol>
  </div>
  <p>
   If you have a source and multiple levels of replicas (that is,
      replicas of replicas), repeat the second step on each level,
      starting from the source, then on all of its replicas, then on all
      of the replicas of these replicas, and so on.
  </p>
  <p>
   If you emply a circular replication topology where multiple
      servers may have write clients, perform the second step for each
      source-replica connection, until you have completed the full
      circle. Repeat this process so that you complete the full circle
      twice.
  </p>
  <p>
   For example, if there are three servers A, B, and C, replicating
      in a circle, so that A replicates to B, B replicates to C, and C
      replicates to A, do as follows, in the order shown:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Perform Step 1 on A, and Step 2 on B.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform Step 1 on B, and Step 2 on C.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform Step 1 on C, and Step 2 on A.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform Step 1 on A, and Step 2 on B.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform Step 1 on B, and Step 2 on C.
     </p>
    </li>
    <li class="listitem">
     <p>
      Perform Step 1 on C, and Step 2 on A.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
