Bug #117291 Improve migration handling of semi-sync plugins from 8.0 to 8.4
Submitted: 25 Jan 19:05 Modified: 27 Jan 11:34
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.4.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: upgrades

[25 Jan 19:05] Simon Mudd
Description:
Upgrading from 8.0 semi-sync master/slave plugins to replica/source setup does not work as expected.

Original setup was having a 8.0 server having the following configuration in /etc/my.cnf

plugin-load-add='rpl_semi_sync_master=semisync_master.so'
plugin-load-add='rpl_semi_sync_slave=semisync_slave.so'
loose_rpl_semi_sync_master_wait_no_slave=0
loose_rpl_semi_sync_master_wait_point=AFTER_SYNC
loose_rpl_semi_sync_master_timeout=10000
loose_rpl_semi_sync_master_enabled=0
loose_rpl_semi_sync_slave_enabled=0

SHOW PLUGINS showed:

+----------------------------------+----------+--------------------+--------------------+-------------+
| Name                             | Status   | Type               | Library            | License     |
+----------------------------------+----------+--------------------+--------------------+-------------+
...
| rpl_semi_sync_master             | ACTIVE   | REPLICATION        | semisync_master.so | GPL         |
| rpl_semi_sync_slave              | ACTIVE   | REPLICATION        | semisync_slave.so  | GPL         |
...
+----------------------------------+----------+--------------------+--------------------+-------------+

A filesystem copy was made to a new 8.4 server using the new semi-sync source/replica configuration:

plugin-load-add='rpl_semi_sync_source=semisync_source.so'
plugin-load-add='rpl_semi_sync_replica=semisync_replica.so'
loose_rpl_semi_sync_source_wait_no_slave=0
loose_rpl_semi_sync_source_wait_point=AFTER_SYNC
loose_rpl_semi_sync_source_timeout=10000
loose_rpl_semi_sync_source_enabled=1
loose_rpl_semi_sync_replica_enabled=1

mysqld startup logging shows:

2025-01-25T11:54:53.350310Z 0 [ERROR] [MY-013766] [Repl] Cannot install the rpl_semi_sync_source plugin when the rpl_semi_sync_master plugin is installed.
2025-01-25T11:54:53.350328Z 0 [ERROR] [MY-010202] [Server] Plugin 'rpl_semi_sync_source' init function returned error.
2025-01-25T11:54:53.350343Z 0 [ERROR] [MY-013766] [Repl] Cannot install the rpl_semi_sync_replica plugin when the rpl_semi_sync_slave plugin is installed.
2025-01-25T11:54:53.350351Z 0 [ERROR] [MY-010202] [Server] Plugin 'rpl_semi_sync_replica' init function returned error.
2025-01-25T11:54:53.355861Z 0 [ERROR] [MY-013766] [Repl] Cannot install the rpl_semi_sync_master plugin when the rpl_semi_sync_source plugin is installed.
2025-01-25T11:54:53.355886Z 0 [ERROR] [MY-010202] [Server] Plugin 'rpl_semi_sync_master' init function returned error.
2025-01-25T11:54:53.355902Z 0 [ERROR] [MY-013766] [Repl] Cannot install the rpl_semi_sync_slave plugin when the rpl_semi_sync_replica plugin is installed.
2025-01-25T11:54:53.355911Z 0 [ERROR] [MY-010202] [Server] Plugin 'rpl_semi_sync_slave' init function returned error.

This leaves:

root@mysql84host [(none)]> select * from mysql.plugin; -- looks ok
+----------------------+--------------------+
| name                 | dl                 |
+----------------------+--------------------+
...
| rpl_semi_sync_master | semisync_master.so |
| rpl_semi_sync_slave  | semisync_slave.so  |
+----------------------+--------------------+
5 rows in set (0.00 sec)

but SHOW PLUGINS has 0 entries for any semi-sync plugin.

Also

root@mysql84host [(none)]> show global variables like '%semi%';
Empty set (0.00 sec)

root@mysql84host [(none)]> show global status like '%semi%';
Empty set (0.00 sec)

This is not expected.

How to repeat:
Follow instructions above.

Suggested fix:
Suggested fix:

1. While all 4 plugins exist do not allow "the other plugin" to be loaded if one is loaded already. e.g. between master/source and slave/replica
2. Improve documentation on the migration process of moving 8.0 to 8.4 semi-sync plugins
3. Remove the master/slave plugins from 8.4 and later as master/slave terminology in theory has been removed
4. Detect during startup upgrades from 8.0 to 8.4 a master/slave plugin configuration and migrate to source/replica and potentially generate warnings if no new configuration on 8.4 in /etc/my.cnf is present.

Temporary workaround until this is resolved:

After performing the MySQL upgrade/or cloning from a 8.0 server do the following:

Check if:
- mysql.plugin shows 2 master/slave plugins loaded
- mysql.plugin shows 0 source/replica plugins loaded
- SHOW PLUGINS shows 2 master/slave plugins loaded
- SHOW PLUGINS shows 0 source/replica plugins loaded
- the my.cnf configuration refers to source/replica only.
- no global variable/status output exists

Other situations may be present, this workaround is for this specific situation.

Fix:
- Uninstall the master/slave plugins using UNINSTALL PLUGIN ... (DO NOT delete plugin entries from mysql.plugin)
- Install source/replica plugins using INSTALL PLUGIN ...
[27 Jan 11:34] MySQL Verification Team
Hi Simon,

Thank you for the report. Verified.