WL#12002: SET system variable values as a component service

Affects: Server-8.0   —   Status: Complete

The replication components need to be able to set system variable values and
provoke the linked effects around these.
E.g. they need to be able to set the OFFLINE_MODE and the SUPER_READ_ONLY variables.

Thus we plan to use this occasion to introduce a more generic and simplified
"write the system variable" values API that also generally useful and does not
suffer the over-engineering issues the current very complex C++ API for setting
system variables has.

WL#9424 adds support to read the system variables values, so that part is
covered and this the current worklog will focus on setting the values only. 

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

InnoDB Cluster Stories (these are the ones we should address
completely):

- As a MySQL GR developer, I want to BLOCK ALL NEW and UNPRIVILEGED
  connections if during startup the server is unable to join the
  group, so that no application connects and executes against the
  server once the startup finishes successfully but without joining a
  group.

- As a MySQL GR developer, I want to KILL ALL EXISTING connections if
  at any point in time, group replication is stopped explicitly by the
  user or implicitly due to an error, so that existing applications
  connected to the server do not read stale data.

- As a MySQL GR developer, I want to BLOCK ALL NEW and UNPRIVILEGED
  connections if at any point in time, group replication is stopped
  explicitly by the user or implicitly due to an error, so that
  existing applications connected to the server do not read stale
  data.

- As a MySQL GR developer, I want to allow only privileged users
  (SUPER?) to connect to the MySQL server, once the server has entered
  an error state after it was in the group or after it failed to join
  the group, so that a privileged user can go in, fix the issue and
  bring the server back ONLINE in the group.

Async replication stories (these are stories we could address if the
service is designed and implemented in a way that we could leverage
for streaming replication):

- As a MySQL Async replication developer, I want to KILL ALL EXISTING
  connections if at any point in time, source-replica replication is
  stopped explicitly by the user or implicitly due to an applier
  error, so that existing applications connected to the server do not
  read stale data.

- As a MySQL Async replication developer, I want to BLOCK ALL NEW and
  UNPRIVILEGED connections if at any point in time, source-replica
  replication is stopped explicitly by the user or implicitly due to
  an error, so that existing applications connected to the server do
  not read stale data.

- As a MySQL async replication developer, I want to only allow
  privileged users (SUPER?) to connect to the MySQL server, once the
  server has entered an error state after it was happily replicating
  from the source or after it failed to start replication, so that a
  privileged user can go in, fix the issue and bring the server back
  in the replication stream.

Generic stories (these are stories we could address if the service is
designed and implemented in a generic way, usable by a
plugin/component writer):

- As a MySQL plugin developer, I want to KILL ALL EXISTING connections
  if at any point in time a certain condition/guarantee/property in
  the plugin is met, so that applications relying on that
  condition/guarantee/property are not broken.

- As a MySQL plugin developer, I want to BLOCK ALL NEW and
  UNPRIVILEGED connections if at any point in time a certain
  condition/guarantee/property in the plugin is met, so that
  applications relying on that condition/guarantee/property are not
  broken.

- As a MySQL plugin developer, I want to only allow privileged users
  (SUPER?) to connect to the MySQL server, once the server has failed
  to meet some condition imposed by the plugin, so that a privileged
  user can go in, fix the issue and bring the server back online.