<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="group-replication-communication-protocol">
      </a>
      20.5.1.4 Setting a Group's Communication Protocol Version
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045133510496">
  </a>
  <p>
   Group Replication in MySQL 8.4 uses the concept of
        a group communication protocol whose version can be managed
        explicitly, and set to accommodate the oldest MySQL Server
        version that you want the group to support. This enables groups
        to be formed from members using different MySQL Server versions
        while ensuring backward compatibility.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      MySQL 5.7.14 and later allows compression of messages (see
      <a class="xref" href="group-replication-message-compression.html" title="20.7.4 Message Compression">
       Section 20.7.4, “Message Compression”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      MySQL 8.0.16 and later also allows fragmentation of messages
            (see
      <a class="xref" href="group-replication-performance-message-fragmentation.html" title="20.7.5 Message Fragmentation">
       Section 20.7.5, “Message Fragmentation”
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      MySQL 8.0.27 and later also allow the group communication
            engine to operate with a single consensus leader when the
            group is in single-primary mode and
      <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 set to true (see
      <a class="xref" href="group-replication-single-consensus-leader.html" title="20.7.3 Single Consensus Leader">
       Section 20.7.3, “Single Consensus Leader”
      </a>
      ).
     </p>
    </li>
   </ul>
  </div>
  <p>
   All members of the group must use the same communication
        protocol version, so that group members can be at different
        MySQL Server releases but only send messages that can be
        understood by all group members.
  </p>
  <p>
   A MySQL server at version X can only join and reach
   <code class="literal">
    ONLINE
   </code>
   status in a replication group if the
        group's communication protocol version is less than or
        equal to X. When a new member joins a replication group, it
        checks the communication protocol version that is announced by
        the existing members of the group. If the joining member
        supports that version, it joins the group and uses the
        communication protocol that the group has announced, even if the
        member supports additional communication capabilities. If the
        joining member does not support the communication protocol
        version, it is expelled from the group.
  </p>
  <p>
   If two members attempt to join in the same membership change
        event, they can only join if the communication protocol version
        for both members is already compatible with the group's
        communication protocol version. Members with different
        communication protocol versions from the group must join in
        isolation. For example:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      One MySQL Server 8.0.16 instance can successfully join a
            group that uses the communication protocol version 5.7.24.
     </p>
    </li>
    <li class="listitem">
     <p>
      One MySQL Server 5.7.24 instance cannot successfully join a
            group that uses the communication protocol version 8.0.16.
     </p>
    </li>
    <li class="listitem">
     <p>
      Two MySQL Server 8.0.16 instances cannot simultaneously join
            a group that uses the communication protocol version 5.7.24.
     </p>
    </li>
    <li class="listitem">
     <p>
      Two MySQL Server 8.0.16 instances can simultaneously join a
            group that uses the communication protocol version 8.0.16.
     </p>
    </li>
   </ul>
  </div>
  <p>
   You can inspect the communication protocol in use by a group by
        using 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, which returns the oldest MySQL Server version that the
        group supports. All existing members of the group return the
        same communication protocol version. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa79507320"><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> group_replication_get_communication_protocol<span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> group_replication_get_communication_protocol() <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 8.0.16                                         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   Note that 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 returns the minimum MySQL version that the group
        supports, which might differ from the version number that was
        passed to 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, and from the MySQL Server version that is installed on
        the member where you use the function.
  </p>
  <p>
   If you need to change the communication protocol version of a
        group so that members at earlier releases can join, 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 specify the MySQL Server version of the oldest
        member that you want to allow. This makes the group fall back to
        a compatible communication protocol version if possible. The
   <a class="link" href="privileges-provided.html#priv_group-replication-admin">
    <code class="literal">
     GROUP_REPLICATION_ADMIN
    </code>
   </a>
   privilege
        is required to use this function, and all existing group members
        must be online when you issue the statement, with no loss of
        majority. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa9513984"><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> group_replication_set_communication_protocol<span class="token punctuation">(</span><span class="token string">"5.7.25"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   If you upgrade all the members of a replication group to a new
        MySQL Server release, the group's communication protocol version
        is not automatically upgraded to match. If you no longer need to
        support members at earlier releases, 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 communication protocol version to the new
        MySQL Server version to which you have upgraded the members. For
        example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa50197999"><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> group_replication_set_communication_protocol<span class="token punctuation">(</span><span class="token string">"8.0.16"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   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 is implemented as a group action, so it is executed at
        the same time on all members of the group. The group action
        starts buffering messages and waits for delivery of any outgoing
        messages that were already in progress to complete, then changes
        the communication protocol version and sends the buffered
        messages. If a member attempts to join the group at any time
        after you change the communication protocol version, the group
        members announce the new protocol version.
  </p>
  <p>
   MySQL InnoDB cluster automatically and transparently manages the
        communication protocol versions of its members, whenever the
        cluster topology is changed using AdminAPI operations. An InnoDB
        cluster always uses the most recent communication protocol
        version that is supported by all the instances that are
        currently part of the cluster or joining it. For details, see
   <a class="ulink" href="/doc/mysql-shell/8.4/en/monitoring-innodb-cluster.html#innodb-cluster-group-replication-protocol" target="_top">
    InnoDB Cluster and Group Replication Protocol
   </a>
   .
  </p>
 </div>
 <br/>
</div>
