<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="group-replication-performance-message-fragmentation">
      </a>
      20.7.5 Message Fragmentation
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045132126000">
  </a>
  <p>
   When an abnormally large message is sent between Group Replication
      group members, it can result in some group members being reported
      as failed and expelled from the group. This is because the single
      thread used by Group Replication's group communication engine
      (XCom, a Paxos variant) is occupied processing the message for too
      long, so some of the group members might report the receiver as
      failed. By default, large messages are automatically split into
      fragments that are sent separately and reassembled by the
      recipients.
  </p>
  <p>
   The system variable
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
    <code class="literal">
     group_replication_communication_max_message_size
    </code>
   </a>
   specifies a maximum message size for Group Replication
      communications, above which messages are fragmented. The default
      maximum message size is 10485760 bytes (10 MiB). The greatest
      permitted value is the same as the maximum value of the
   <a class="link" href="replication-options-replica.html#sysvar_replica_max_allowed_packet">
    <code class="literal">
     replica_max_allowed_packet
    </code>
   </a>
   system
      variable (1 GB).
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
    <code class="literal">
     group_replication_communication_max_message_size
    </code>
   </a>
   must be less than
   <a class="link" href="replication-options-replica.html#sysvar_replica_max_allowed_packet">
    <code class="literal">
     replica_max_allowed_packet
    </code>
   </a>
   because the applier thread cannot handle message fragments larger
      than the maximum permitted packet size. To switch off
      fragmentation, specify a zero value for
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
    <code class="literal">
     group_replication_communication_max_message_size
    </code>
   </a>
   .
  </p>
  <p>
   As with most other Group Replication system variables, you must
      restart the Group Replication plugin for the change to take
      effect. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa3477290"><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">STOP</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> group_replication_communication_max_message_size<span class="token operator">=</span> <span class="token number">5242880</span><span class="token punctuation">;</span>
<span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Message delivery for a fragmented message is considered complete
      when all the fragments of the message have been received and
      reassembled by all the group members. Fragmented messages include
      information in their headers that enables a member joining during
      message transmission to recover the earlier fragments that were
      sent before it joined. If the joining member fails to recover the
      fragments, it expels itself from the group.
  </p>
  <p>
   The Group Replication communication protocol version in use by the
      group must allow fragmentation. You can obtain the communication
      protocol in use by a group using
   <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>
   ,
      which returns the oldest MySQL Server version that the group
      supports. If necessary, use
   <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>
   to set the communication protocol version high enough (8.0.16 or
      above) to allow fragmentation. 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>
  <p>
   If a replication group cannot use fragmentation because some
      members do not support it, the system variable
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_transaction_size_limit">
    <code class="literal">
     group_replication_transaction_size_limit
    </code>
   </a>
   can be used to limit the maximum size of transactions the group
      accepts. Transactions above this size are rolled back. You can
      also use
   <a class="link" href="group-replication-system-variables.html#sysvar_group_replication_member_expel_timeout">
    <code class="literal">
     group_replication_member_expel_timeout
    </code>
   </a>
   to allow additional time (up to an hour) before a member under
      suspicion of having failed is expelled from the group.
  </p>
 </div>
 <br/>
</div>
