MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
Replication Test Coverage in MySQL 8.0

In the Replication QA team, we have been continuing to improve test coverage for Replication and Group Replication primarily to ensure that we support the newest and latest offerings of MySQL Server 8.0 such as Generated Columns, Set Persist, User Roles, and User Management DDLs that are now atomic.

As a rule, we include tests for both MySQL Replication (master/slave, asynchronous replication) and Group Replication (group membership) topologies to ensure everything works out of the box with defaults.

In this blog, we discuss several additions to the MySQL QA testing suite (MTR). These additions were managed under several worklogs as discussed below. We also note the engineer who implemented the tests.

WL#9776 Add/Extend mtr tests for replication with Generated Columns and X Plugin (Parveez Baig)

Generated columns (also known as virtual or computed columns) is a very interesting feature introduced in MySQL 8.0. The server now provides two types of the generated columns; stored, and virtual. Stored columns are calculated and stored physically when the data is updated. Virtual columns are calculated on the fly each time data is read. For MySQL Replication, we have added tests to ensure that we support regular and XA transactions on generated columns and that they are replicated successfully.

As part of this work, we have also added support for the MySQL X Plugin it was released in MySQL 5.7. It supports a CRUD-style programming interface in addition to the traditional SQL language for use with the MySQL Document Store and relational data. Here, we ensure that replication of documents and traditional data (SQL) are replicated using regular and XA transactions.

The list of MTR tests includes the following:

  • rpl.rpl_xa_plugin.test
  • rpl.rpl_xa_generated_columns.test

WL#10885 Add/Extend mtr tests for Replication/GR variables with set persist (Narendra Chauhan)

MySQL 8.0 has introduced a new feature which will allow configuration variables to be persisted. Persisting configuration variables has become a very important feature and making values persisted for static/dynamic variables after restarts saves DBA time to re-setup the DB to its same state. This applies also for MySQL Replication and Group Replication configuration variables. We have ensured that support for Replication and Group Replication variables static/dynamic are covered in the tests. Here, Group Replication and semi-sync replication plugins have also been considered when plugins are loaded and unloaded to ensure the configurations are persisted correctly.

The list of MTR tests includes the following:

  • binlog_nogtid.binlog_persist_only_variables.test
  • binlog_nogtid.binlog_persist_variables.test
  • group_replication.gr_persist_only_variables.test
  • group_replication.gr_persist_variables.test
  • group_replication.gr_persisted_variables_without_plugin.test

WL#10886 Add/Extend mtr tests for Replication/GR for Roles (Deepthi ES)

A MySQL role is a named collection of privileges. Like user accounts, roles can have privileges granted to and revoked from them. Thus, we added tests to support roles with replication users that are used in the CHANGE MASTER TO command to ensure they work as expected for both MySQL Replication and Group Replication. For example, we ensure activating the role in the ALTER USER command is successful. In addition, we ensure MySQL Replication and Group Replication commands are successful when different privileges are granted for roles.

The list of MTR tests includes the following:

  • rpl.rpl_roles.test
  • group_replication.gr_roles.test

WL#11144 Improve test coverage for create user/alter/drop if exists with replication (Parveez Baig)

User management DDLs are atomic now in 8.0. Thus, we have added tests to cover the CREATE/DROP/ALTER IF [NOT] EXISTS commands when used with replication. For example, determining whether single and multiple users that exist on master and slave are logged (or not). On MySQL 8.0, if an operation is expected to be atomic, we check that it is not logged in the binary log and does not generate the GTID. On MySQL 5.7, we check that the operation is logged in the binary log and works correctly.

The list of MTR tests includes the following:

  • rpl.rpl_user_if_exists.test

We have also added tests in MySQL 8.0 for a few features in MySQL 5.7 to further improve test coverage for MySQL Replication and Group Replication.

WL#11046 Improve test coverage for online alter index and multiple triggers on a single table in RPL & GR (Dhruthi KV)

Multiple triggers per table was introduced in 5.7. Thus, we have added tests to cover multiple triggers on a table for an action or timing attributes (ACTION_ORDER and CREATED) if they are preserved across replication servers (MySQL Replication master/slave and Group Replication members). Also, Online rename index was added in 5.7. Thus, we have added tests to cover and ensure an index is correctly renamed across replication servers when the ALTER TABLE…RENAME INDEX command is used.

The list of mtr tests includes the following:

  • rpl.rpl_rename_index
  • rpl.rpl_multiple_trigger
  • group_replication.gr_multiple_trigger
  • group_replication.gr_rename_index

For information on how to run the MTR tests, please see MYSQL_TEST_RUN.

We hope the improvements in tests and testing listed above will help users to try MySQL 8.0 Replication. Please feel free to provide us your suggestions. We are looking forward for your valuable feedback.