WL#10379: Group Replication: consistent reads

Affects: Server-8.0   —   Status: Complete

EXECUTIVE SUMMARY
=================
Implement consistency guarantees on Group Replication, that is,
allow the user to configure globally or per transaction the
consistency provided by the group.

Four guarantees are provided:
- EVENTUAL (current behavior)
  A RO (read-only) or RW (read-write) transaction shall not wait
  for preceding transactions to be applied before executing.
  A RW transaction shall not wait for other members to apply a
  transaction.

- BEFORE
  A RW transaction shall wait for all preceding transactions to
  complete before execution takes place.
  A RO transaction shall wait for all preceding transactions to
  complete before execution takes place.

- AFTER
  A RW transaction will wait until its changes have been applied to
  on other members.
  No effect on RO transactions.

- BEFORE_AND_AFTER
  A RW transaction will wait for 1) all preceding transactions to
  complete before execution takes place and 2) until its changes have
  been applied on other members.
  A RO transaction shall wait for all preceding transactions to
  complete before execution takes place.


USER STORIES
============
- As a developer using MySQL I want specific transactions in my
  workload to always read up-to-date data from the group, so that
  whenever I update sensitive data (such as credentials for a file
  or similar data) I will enforce that reads shall read the most up
  to date value.

- As a developer using MySQL I want to load balance my reads without
  worrying about stale reads.

- As a developer using MySQL who has a predominantly read-only data,
  I want my RW transactions to be applied everywhere once they
  commit, so that subsequent reads are done on up-to-date data that
  includes my latest write and I do not pay the synchronization on
  every RO transaction, but only on RW ones.


SCOPE
=====
This feature is about providing consistency guarantees, it is not
intended to provide fencing mechanisms for member failures.
A non ONLINE member it is already fenced by Router, super_read_only
and group_replication_exit_state_action system variables.

This fits in the overall roadmap scheme of making a group provide
different distributed consistency guarantees to the application.