<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="group-replication-tuning-recovery">
      </a>
      20.5.4.3 Configuring Distributed Recovery
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045132979536">
  </a>
  <p>
   Several aspects of Group Replication's distributed recovery
        process can be configured to suit your system.
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="idm46045132977504">
       </a>
       Number of Connection Attempts
      </h5>
     </div>
    </div>
   </div>
   <p>
    For state transfer from the binary log, Group Replication
          limits the number of attempts a joining member makes when
          trying to connect to a donor from the pool of donors. If the
          connection retry limit is reached without a successful
          connection, the distributed recovery procedure terminates with
          an error. Note that this limit specifies the total number of
          attempts that the joining member makes to connect to a donor.
          For example, if 2 group members are suitable donors, and the
          connection retry limit is set to 4, the joining member makes 2
          attempts to connect to each of the donors before reaching the
          limit.
   </p>
   <p>
    The default connection retry limit is 10. You can configure
          this setting using the
    <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_retry_count">
     <code class="literal">
      group_replication_recovery_retry_count
     </code>
    </a>
    system variable. The following statement sets the maximum
          number of attempts to connect to a donor to 5:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa98773774"><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">SET</span> <span class="token keyword">GLOBAL</span> group_replication_recovery_retry_count<span class="token operator">=</span> <span class="token number">5</span><span class="token punctuation">;</span></code></pre>
   </div>
   <p>
    For remote cloning operations, this limit does not apply.
          Group Replication makes only one connection attempt to each
          suitable donor for cloning, before starting to attempt state
          transfer from the binary log.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="idm46045132971312">
       </a>
       Sleep Interval for Connection Attempts
      </h5>
     </div>
    </div>
   </div>
   <p>
    For state transfer from the binary log, the
    <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_reconnect_interval">
     <code class="literal">
      group_replication_recovery_reconnect_interval
     </code>
    </a>
    system variable defines how much time the distributed recovery
          process should sleep between donor connection attempts. Note
          that distributed recovery does not sleep after every donor
          connection attempt. As the joining member is connecting to
          different servers and not to the same one repeatedly, it can
          assume that the problem that affects server A does not affect
          server B. Distributed recovery therefore suspends only when it
          has gone through all the possible donors. Once the server
          joining the group has made one attempt to connect to each of
          the suitable donors in the group, the distributed recovery
          process sleeps for the number of seconds configured by the
    <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_reconnect_interval">
     <code class="literal">
      group_replication_recovery_reconnect_interval
     </code>
    </a>
    system variable. For example, if 2 group members are suitable
          donors, and the connection retry limit is set to 4, the
          joining member makes one attempt to connect to each of the
          donors, then sleeps for the connection retry interval, then
          makes one further attempt to connect to each of the donors
          before reaching the limit.
   </p>
   <p>
    The default connection retry interval is 60 seconds, and you
          can change this value dynamically. The following statement
          sets the distributed recovery donor connection retry interval
          to 120 seconds:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa52545286"><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">SET</span> <span class="token keyword">GLOBAL</span> group_replication_recovery_reconnect_interval<span class="token operator">=</span> <span class="token number">120</span><span class="token punctuation">;</span></code></pre>
   </div>
   <p>
    For remote cloning operations, this interval does not apply.
          Group Replication makes only one connection attempt to each
          suitable donor for cloning, before starting to attempt state
          transfer from the binary log.
   </p>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="idm46045132962880">
       </a>
       Marking the Joining Member Online
      </h5>
     </div>
    </div>
   </div>
   <p>
    When distributed recovery has successfully completed state
          transfer from the donor to the joining member, the joining
          member can be marked as online in the group and ready to
          participate. This is done after the new member has received
          and applied all the transactions that it missed prior to
          joining the group.
   </p>
  </div>
 </div>
 <br/>
</div>
