<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="replication-channels">
      </a>
      19.2.2 Replication Channels
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="channels-commands-single-channel.html">
       19.2.2.1 Commands for Operations on a Single Channel
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="channels-with-prev-replication.html">
       19.2.2.2 Compatibility with Previous Replication Statements
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="channels-startup-options.html">
       19.2.2.3 Startup Options and Replication Channels
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="channels-naming-conventions.html">
       19.2.2.4 Replication Channel Naming Conventions
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045138188240">
  </a>
  <a class="indexterm" name="idm46045138187168">
  </a>
  <p>
   In MySQL multi-source replication, a replica opens multiple
    replication channels, one for each source server. The replication
    channels represent the path of transactions flowing from a source to
    the replica. Each replication channel has its own receiver (I/O)
    thread, one or more applier (SQL) threads, and relay log. When
    transactions from a source are received by a channel's receiver
    thread, they are added to the channel's relay log file and
    passed through to the channel's applier threads. This enables each
    channel to function independently.
  </p>
  <p>
   This section describes how channels can be used in a replication
    topology, and the impact they have on single-source replication. For
    instructions to configure sources and replicas for multi-source
    replication, to start, stop and reset multi-source replicas, and to
    monitor multi-source replication, see
   <a class="xref" href="replication-multi-source.html" title="19.1.5 MySQL Multi-Source Replication">
    Section 19.1.5, “MySQL Multi-Source Replication”
   </a>
   .
  </p>
  <p>
   The maximum number of channels that can be created on one replica
    server in a multi-source replication topology is 256. Each
    replication channel must have a unique (nonempty) name, as explained
    in
   <a class="xref" href="channels-naming-conventions.html" title="19.2.2.4 Replication Channel Naming Conventions">
    Section 19.2.2.4, “Replication Channel Naming Conventions”
   </a>
   . The error codes
    and messages that are issued when multi-source replication is
    enabled specify the channel that generated the error.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Each channel on a multi-source replica must replicate from a
      different source. You cannot set up multiple replication channels
      from a single replica to a single source. This is because the
      server IDs of replicas must be unique in a replication topology.
      The source distinguishes replicas only by their server IDs, not by
      the names of the replication channels, so it cannot recognize
      different replication channels from the same replica.
   </p>
  </div>
  <p>
   A multi-source replica can also be set up as a multi-threaded
    replica, by setting the system variable
   <a class="link" href="replication-options-replica.html#sysvar_replica_parallel_workers">
    <code class="literal">
     replica_parallel_workers
    </code>
   </a>
   to a value
    greater than 0. When you do this on a multi-source replica, each
    channel on the replica has the specified number of applier threads,
    plus a coordinator thread to manage them. You cannot configure the
    number of applier threads for individual channels.
  </p>
  <p>
   Multi-source replicas can be configured with replication filters on
    specific replication channels. Channel specific replication filters
    can be used when the same database or table is present on multiple
    sources, and you only need the replica to replicate it from one
    source. For GTID-based replication, if the same transaction might
    arrive from multiple sources (such as in a diamond topology), you
    must ensure the filtering setup is the same on all channels. For
    more information, see
   <a class="xref" href="replication-rules-channel-based-filters.html" title="19.2.5.4 Replication Channel Based Filters">
    Section 19.2.5.4, “Replication Channel Based Filters”
   </a>
   .
  </p>
  <p>
   To provide compatibility with previous versions, the MySQL server
    automatically creates on startup a default channel whose name is the
    empty string (
   <code class="literal">
    ""
   </code>
   ). This channel is always
    present; it cannot be created or destroyed by the user. If no other
    channels (having nonempty names) have been created, replication
    statements act on the default channel only, so that all replication
    statements from older replicas function as expected (see
   <a class="xref" href="channels-with-prev-replication.html" title="19.2.2.2 Compatibility with Previous Replication Statements">
    Section 19.2.2.2, “Compatibility with Previous Replication Statements”
   </a>
   . Statements
    applying to replication channels as described in this section can be
    used only when there is at least one named channel.
  </p>
 </div>
 <br/>
</div>
