WL#6959: Deprecate master.info and relay-log.info files

Affects: Server-8.0   —   Status: Complete

EXECUTIVE SUMMARY
=================

This worklog implements a deprecation warning in the server when
either relay-log-info-repository or master-info-repository are set to
FILE instead of TABLE. The default setting is TABLE for both options
and is also the most crash-safe setup.

Background
==========

This task aims at deprecating the options master_info_repository=FILE
and relay_log_info_repository=FILE. The alternative for the same
is master_info_repository=TABLE and relay_log_info_repository= TABLE.

The replication team has implemented crash-safety for the slave by
adding the ability of committing the replication information together
with the transaction.  This means that replication information will
always be consistent with has been applied to the database, even in
the event of a server crash.

Earlier, replication information was stored in two files: master.info
and relay-log.info. The update of these files were arranged in such a
way that they are updated after a transaction had been applied. This
means that if you had a crash between the transaction commit and the
update of the files, the replication progress information would be
wrong.

We implemented system tables for master.info and relay-log.info
files, which allows storing the replication metadata together with the
data itself in a transactional way.

Rationale
=========

- We want users to use TABLE repository going forward, since it is
  transactional.

- The new data dictionary in 8.0 makes the server store the metadata
  in InnoDB.

- New features require TABLE repositories (Multisource, GR).

- We want replication to be safe and not use MyISAM tables or depend
  on external files as much as possible.

- The default is to store replication metadata in InnoDB tables
  already in MySQL 8.
REQUIREMENTS
============

FR1. server SHALL emit a warning in the session when configuring
     relay-log-info-repository=FILE in the session (SET GLOBAL
     relay_log...)

FR2. server SHALL emit a warning, at server start time, when
     configuring relay-log-info-repository=FILE in the server
     configuration file (relay_log_info_repository=FILE)

FR3. server SHALL emit a warning in the session when configuring
     master-info-repository=FILE in the session (SET GLOBAL
     master_info...)

FR4. server SHALL emit a warning, at server start time, when
     configuring master-info-repository=FILE in the server
     configuration file (master_info_repository=FILE)
User Visible Changes
====================

- Deprecation Warning in the session when setting
  relay-log-info-repository=FILE dynamically

The user visible change is that a deprecation warning will be emited
when the user configures relay-log-info-repository=FILE in the
session:

  mysql> SET GLOBAL relay_log_info_repository=FILE;
  Query OK, 0 rows affected, 1 warning (0,00 sec)

  mysql> SHOW WARNINGS\G
  *************************** 1. row ***************************
    Level: Warning
     Code: 1287
  Message: 'FILE' is deprecated and will be removed in a future release. Please
use 'TABLE' instead
  1 row in set (0,00 sec)

- Deprecation Warning in the error log when setting
  relay-log-info-repository=FILE in the server configuration

The user visible change is that a deprecation warning will be emited
when the user configures relay-log-info-repository in the config file
and the server is restarted. Example:

2017-07-04T09:56:39.716101Z 0 [Warning] The syntax
'--relay-log-info-repository=FILE' is deprecated and will be removed in a future
release. Please use '--relay-log-info-repository=TABLE' instead.

- Deprecation Warning in the session when setting
  master-info-repository=FILE dynamically

The user visible change is that a deprecation warning will be emited
when the user configures relay-log-info-repository=FILE in the
session:

  mysql> SET GLOBAL master_info_repository=FILE;
  Query OK, 0 rows affected, 1 warning (0,00 sec)

  mysql> SHOW WARNINGS\G
  *************************** 1. row ***************************
    Level: Warning
     Code: 1287
  Message: 'FILE' is deprecated and will be removed in a future release. Please
use 'TABLE' instead
  1 row in set (0,01 sec)

- Deprecation Warning in the error log when setting
  relay-log-info-repository=FILE in the server configuration

The user visible change is that a deprecation warning will be emited
when the user configures master-info-repository in the config file and
the server is restarted. Example:

2017-07-04T09:56:45.146538Z 0 [Warning] The syntax
'--master-info-repository=FILE' is deprecated and will be removed in a future
release. Please use '--master-info-repository=TABLE' instead.

Upgrades
========

After using MySQL 8, the user will get the deprecation warnings as
described in the previous section.  This however, shall not break
backwards compatibility.

Security
========

There are no security considerations.

Observability
=============

There are no observability considerations. There is no new
functionality added only a new warning is emited.
LOW LEVEL CHANGES
=================

1. Deploy ON_UPDATE functions for the system variables
   relay_log_info_repository and master_info_repository, that will
   conditionally emit the deprecation warning (depending on the new
   value).

2. Deploy conditional calls to push_deprecated_warn in get_options, so
   that the warning is pushed at server start time, when the options
   are set to FILE.

3. Add deprecation test case validating session and server start
   warnings.