Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 48.1Mb
PDF (A4) - 48.1Mb
PDF (RPM) - 43.5Mb
HTML Download (TGZ) - 11.0Mb
HTML Download (Zip) - 11.1Mb
HTML Download (RPM) - 9.5Mb
Man Pages (TGZ) - 237.9Kb
Man Pages (Zip) - 342.7Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  Replication Channels

17.2.3 Replication Channels

In MySQL multi-source replication, a slave opens multiple replication channels, one for each master. The replication channels represent the path of transactions flowing from a master to the slave. Each replication channel has its own receiver (I/O) thread, one or more applier (SQL) threads, and relay log. When transactions from a master 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.

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 masters and slaves for multi-source replication, to start, stop and reset multi-source slaves, and to monitor multi-source replication, see Section 17.1.4, “MySQL Multi-Source Replication”.

The maximum number of channels that can be created on one slave in a multi-source replication topology is 256. Each replication channel must have a unique (nonempty) name, as explained in Section 17.2.3.4, “Replication Channel Naming Conventions”. The error codes and messages that are issued when multi-source replication is enabled specify the channel that generated the error.

Note

Each channel on a multi-source replication slave must replicate from a different master. You cannot set up multiple replication channels from a single slave to a single master. This is because the server IDs of replication slaves must be unique in a replication topology. The master distinguishes slaves only by their server IDs, not by the names of the replication channels, so it cannot recognize different replication channels from the same slave.

A multi-source replication slave can also be set up as a multi-threaded replication slave, by setting the slave_parallel_workers system variable to a value greater than 0. When you do this on a multi-source replication slave, each channel on the slave 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.

From MySQL 8.0, multi-source replication slaves 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 masters, and you only need the slave to replicate it from one master. For more information, see Section 17.2.5.4, “Replication Channel Based Filters”.

To provide compatibility with previous versions, the MySQL server automatically creates on startup a default channel whose name is the empty string (""). 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 slaves function as expected (see Section 17.2.3.2, “Compatibility with Previous Replication Statements”. Statements applying to replication channels as described in this section can be used only when there is at least one named channel.