WL#13767: Group Replication: specify through which endpoints can recovery traffic flow

Affects: Server-8.0   —   Status: Complete

Executive Summary
=================

This worklog implements a mechanism to specify which ips and ports a donor
shall advertise as its endpoints. Then a joiner shall try to connect to them,
in order to pull binary logs, during distributed recovery.

User/Dev Stories
================

As a MySQL Operator I want to specify through which interfaces
can group replication recovery take place for a given member
so that I restrict where recovery traffic flows in my network
infrastructure.

Scope
=====

The work described in this document does:

- implement group replication variable
  `group_replication_advertise_recovery_endpoints` with recovery
  points available from this donor
- implement validation on variable
  `group_replication_advertise_recovery_endpoints`, endpoints shall
  be reachable from the donor
- implement on the joiner a iteration mechanism over recovery endpoints to
  execute recovery/clone from first endpoint available

This worklog shall not implement:

- support for disabling recovery on some hosts (e.g., donor
  advertising an empty list of recovery endpoints).
- advertising recovery endpoints that are not part of the
  donor's host IP:ports

High Level Description
======================

When a member joins a group in Group Replication, it goes through
distributed recovery to fetch the missing transactions to fill in
the gap between its state and the global state of the group.
Distributed recovery establishes clone and asynchronous
replication connections with a member of the group to get the data.
The host and port of that member is fetched by the member
information that all group members have, which among other things
have the host and port of all members. Each member advertises its
own recovery socket address (IP:port) when they join the group.

The admin_address is a bind address for administrative access,
it can used to split connectors traffic from replication
(internal) traffic, that is, client connections are accepted on
bind_address[2] whereas internal traffic like Replication, is accepted on
admin_address. This separation of context allows the DBA to better
secure its network, for instance, enforce throttling on client
connections and keep replication unbounded.

On top of that, bind_address[2] can be configured with multiple addresses or
wildcard address.

A donor from Group Replication will transmit a string with DEFAULT or a list
recovery endpoints where a member can do the recovery process.

On distributed recovery the donor address and port will be selected
following these rules:
  if the donor version is <= 8.0.20:
    1) use the values listed on performance_schema.replication_group_members table.
  if the donor has group_replication_advertise_recovery_endpoints (8.0.21+):
    1) if DEFAULT use the values listed on
       performance_schema.replication_group_members table.
    2) otherwise iterate on endpoints to connect and execute recovery/clone

[1] https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_admin_address
[2] https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_bind_address