WL#8843: Deprecate and remove the parameter innodb_support_xa

Affects: Server-8.0   —   Status: Complete   —   Priority: Medium

When support for two-phase commit (XA 2PC) was introduced in InnoDB in MySQL
5.0, the session parameter innodb_support_xa=OFF was introduced to disable the
functionality, due to perceived overhead in the InnoDB undo log.

The default value of innodb_support_xa was ON already in May 2007 (built-in
InnoDB in MySQL 5.1).

This parameter is fundamentally broken.

(1) When innodb_support_xa=OFF in the current session, the XA PREPARE statement
will be silently ignored. That is, if the server is killed after the XA PREPARE
completed, the transaction would be rolled back by InnoDB; there is no way to XA
COMMIT it after restarting the server.

(2) The MySQL binlog internally uses XA 2PC to make itself consistent with the
InnoDB undo logs. When innodb_support_xa=OFF, this logic will be broken as well.
This prevents the performance gain of group commit.

This worklog will deprecate the parameter innodb_support_xa in MySQL 5.7,
so that XA 2PC will always be available for InnoDB.
Setting the parameter to either ON or OFF will generate a deprecation warning,
and setting it to OFF will generate an additional warning that it cannot
be turned OFF. Internally, InnoDB will ignore the setting in 5.7 so that it is
effectively always ON, so that XA 2PC will always be available for InnoDB.

In MySQL 8.0, all code related to innodb_support_xa will be removed.
In 5.7.10:

FR1: A deprecation warning is issued to the error log if
--skip-innodb-support-xa or --innodb-support-xa=0 is specified on startup.
FR2: A deprecation warning is issued to the client connection for any
SET [GLOBAL] innodb_support_xa=…;
FR3: For SET [GLOBAL] innodb_support_xa=OFF, a second message is issued that
warns that this setting cannot be set to OFF since it makes replication unsafe
and prevents the performance gain from group commit in the binlog.

In 8.0:

The setting is rejected and will prevent startup if found in the config file.
Removal of low-level code in 5.7 (rb#10114) and 5.8 (rb#10115):


In trx0undo.cc, all 3 occurrences of
	if (trx->support_xa)
will be removed, but the "if" body will be preserved.

Deprecation in 5.7 (rb#10114):

innodb_support_xa_update(): A new "update callback" function for
SET [GLOBAL|SESSION] innodb_support_xa. Issue a deprecation warning
when either the global or the session variable is set to ON or DEFAULT.
Issue an additional warning when the variable is set to OFF,
saying that it cannot be set to OFF.
The only possible value will be ON.

innobase_init(): Issue a deprecation warning if --skip-innodb-support-xa
on startup.
TBD: Can we distinguish --innodb-support-xa=1 from the default?

Removal in 5.8 (rb#10115):

The session variable innodb_support_xa will be removed, along with the
5.7 deprecation code mentioned in the previous section.

(See HLS/IS)