<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="group-replication-responses-failure-rejoin">
      </a>
      20.7.7.3 Auto-Rejoin
     </h4>
    </div>
   </div>
  </div>
  <p>
   The
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_autorejoin_tries">
    <code class="literal">
     group_replication_autorejoin_tries
    </code>
   </a>
   system variable makes a member that has been expelled or reached
        its unreachable majority timeout try to rejoin the group
        automatically. The default (3), means that the member
        automatically makes 3 attempts to rejoin the group, with 5
        minutes between each attempt.
  </p>
  <p>
   When auto-rejoin is not activated, a member accepts its
        expulsion as soon as it resumes communication, and proceeds to
        the action specified by the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_exit_state_action">
    <code class="literal">
     group_replication_exit_state_action
    </code>
   </a>
   system variable. After this, manual intervention is needed to
        bring the member back into the group. Using the auto-rejoin
        feature is appropriate if you can tolerate the possibility of
        stale reads and want to minimize the need for manual
        intervention, especially where transient network issues fairly
        often result in the expulsion of members.
  </p>
  <p>
   With auto-rejoin, when the member's expulsion or unreachable
        majority timeout is reached, it makes an attempt to rejoin
        (using the current plugin option values), then continues to make
        further auto-rejoin attempts up to the specified number of
        tries. After an unsuccessful auto-rejoin attempt, the member
        waits 5 minutes before the next try. The auto-rejoin attempts
        and the time between them are called the auto-rejoin procedure.
        If the specified number of tries is exhausted without the member
        rejoining or being stopped, the member proceeds to the action
        specified by the
   <code class="literal">
    group_replication_exit_state_action
   </code>
   system
        variable.
  </p>
  <p>
   During and between auto-rejoin attempts, a member remains in
        super read only mode and displays an
   <code class="literal">
    ERROR
   </code>
   state on its view of the replication group. During this time,
        the member does not accept writes. However, reads can still be
        made on the member, with an increasing likelihood of stale reads
        over time. If you do want to intervene to take the member
        offline during the auto-rejoin procedure, the member can be
        stopped manually at any time by using a
   <a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
    <code class="literal">
     STOP GROUP_REPLICATION
    </code>
   </a>
   statement
        or shutting down the server. If you cannot tolerate the
        possibility of stale reads for any period of time, set the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_autorejoin_tries">
    <code class="literal">
     group_replication_autorejoin_tries
    </code>
   </a>
   system variable to 0.
  </p>
  <p>
   You can monitor the auto-rejoin procedure using the Performance
        Schema. While an auto-rejoin procedure is taking place, the
        Performance Schema table
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   shows the
        event
   <span class="quote">
    “
    <span class="quote">
     Undergoing auto-rejoin procedure
    </span>
    ”
   </span>
   , with the
        number of retries that have been attempted so far during this
        instance of the procedure (in the
   <code class="literal">
    WORK_COMPLETED
   </code>
   column). The
   <a class="link" href="performance-schema-stage-summary-tables.html" title="29.12.20.2 Stage Summary Tables">
    <code class="literal">
     events_stages_summary_global_by_event_name
    </code>
   </a>
   table shows the number of times the server instance has
        initiated the auto-rejoin procedure (in the
   <code class="literal">
    COUNT_STAR
   </code>
   column). The
   <a class="link" href="performance-schema-events-stages-history-long-table.html" title="29.12.5.3 The events_stages_history_long Table">
    <code class="literal">
     events_stages_history_long
    </code>
   </a>
   table
        shows the time each of these auto-rejoin procedures was
        completed (in the
   <code class="literal">
    TIMER_END
   </code>
   column). While a
        member is rejoining a replication group, its status can be
        displayed as
   <code class="literal">
    OFFLINE
   </code>
   or
   <code class="literal">
    ERROR
   </code>
   before the group completes the
        compatibility checks and accepts it as a member. When the member
        is catching up with the group's transactions, its status is
   <code class="literal">
    RECOVERING
   </code>
   .
  </p>
 </div>
 <br/>
</div>
