<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="group-replication-single-consensus-leader">
      </a>
      20.7.3 Single Consensus Leader
     </h3>
    </div>
   </div>
  </div>
  <p>
   By default, the group communication engine for Group Replication
      (XCom, a Paxos variant) operates using every member of the
      replication group as a leader. The group communication engine can
      use a single leader to drive consensus when the group is in
      single-primary mode. Operating with a single consensus leader
      improves performance and resilience in single-primary mode,
      particularly when some of the group’s secondary members are
      currently unreachable.
  </p>
  <p>
   To use a single consensus leader, the group must be configured as
      follows:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The group must be in single-primary mode.
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_paxos_single_leader">
       <code class="literal">
        group_replication_paxos_single_leader
       </code>
      </a>
      system variable must be set to
      <code class="literal">
       ON
      </code>
      . With the
          default setting
      <code class="literal">
       OFF
      </code>
      , the behavior is
          disabled. You must carry out a full reboot of the replication
          group (bootstrap) for Group Replication to pick up a change to
          this setting.
     </p>
    </li>
    <li class="listitem">
     <p>
      The Group Replication communication protocol version must be
          set to 8.0.27 or later. Use the
      <a class="link" href="group-replication-functions-for-communication-protocol.html#function_group-replication-get-communication-protocol">
       <code class="literal">
        group_replication_get_communication_protocol()
       </code>
      </a>
      function to view the group's communication protocol version.
          If a lower version is in use, the group cannot use this
          behavior. You can use the
      <a class="link" href="group-replication-functions-for-communication-protocol.html#function_group-replication-set-communication-protocol">
       <code class="literal">
        group_replication_set_communication_protocol()
       </code>
      </a>
      function to set the group's communication protocol to a higher
          version if all group members support it. MySQL InnoDB Cluster
          manages the communication protocol version automatically. For
          more information, see
      <a class="xref" href="group-replication-communication-protocol.html" title="20.5.1.4 Setting a Group's Communication Protocol Version">
       Section 20.5.1.4, “Setting a Group's Communication Protocol Version”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   When this configuration is in place, Group Replication instructs
      the group communication engine to use the group’s primary as the
      single leader to drive consensus. When a new primary is elected,
      Group Replication tells the group communication engine to use it
      instead. If the primary is currently unhealthy, the group
      communication engine uses an alternative member as the consensus
      leader. The Performance Schema table
   <a class="link" href="performance-schema-replication-group-communication-information-table.html" title="29.12.11.10 The replication_group_communication_information Table">
    <code class="literal">
     replication_group_communication_information
    </code>
   </a>
   shows the current preferred and actual consensus leader, with the
      preferred leader being Group Replication’s choice, and the
      actual leader being the one selected by the group communication
      engine.
  </p>
  <p>
   If the group is in multi-primary mode, has a lower communication
      protocol version, or the behavior is disabled by the
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_paxos_single_leader">
    <code class="literal">
     group_replication_paxos_single_leader
    </code>
   </a>
   setting, all members are used as leaders to drive consensus. In
      this situation, the Performance Schema table
   <a class="link" href="performance-schema-replication-group-communication-information-table.html" title="29.12.11.10 The replication_group_communication_information Table">
    <code class="literal">
     replication_group_communication_information
    </code>
   </a>
   shows all of the members as both the preferred and actual leaders.
  </p>
  <p>
   The
   <code class="literal">
    WRITE_CONSENSUS_SINGLE_LEADER_CAPABLE
   </code>
   column of the Performance Schema table
   <a class="link" href="performance-schema-replication-group-communication-information-table.html" title="29.12.11.10 The replication_group_communication_information Table">
    <code class="literal">
     replication_group_communication_information
    </code>
   </a>
   shows whether the group supports the use of a single leader, even
      if
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_paxos_single_leader">
    <code class="literal">
     group_replication_paxos_single_leader
    </code>
   </a>
   is currently set to
   <code class="literal">
    OFF
   </code>
   on the queried member.
      The column value is 1 if the group was started with
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_paxos_single_leader">
    <code class="literal">
     group_replication_paxos_single_leader
    </code>
   </a>
   set to
   <code class="literal">
    ON
   </code>
   , and its communication protocol
      version is MySQL 8.0.27 or above. This information is returned
      only for group members in
   <code class="literal">
    ONLINE
   </code>
   or
   <code class="literal">
    RECOVERING
   </code>
   state.
  </p>
 </div>
 <br/>
</div>
