[MDEV-21873] 10.2 to 10.3 upgrade doesn't remove semi-sync reference from mysql.plugin table Created: 2020-03-04  Updated: 2022-04-09  Resolved: 2022-03-25

Status: Closed
Project: MariaDB Server
Component/s: Plugins, Scripts & Clients
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.3.35, 10.4.25

Type: Bug Priority: Critical
Reporter: Muhammad Irfan Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-22085 mysql_upgrade should check for unavai... Closed

 Description   

I noticed that upgrade from 10.2 -> 10.3 doesn't remove semi-sync reference from mysql.plugin table. As per documentation:

In MariaDB 10.3.3 and later, the Semisynchronous Replication feature is built into MariaDB server and is no longer provided by a plugin. This means that installing the plugin is not supported on those versions. In MariaDB 10.3.3 and later, you can skip right to Enabling Semisynchronous Replication.

So, when Semisynchronous is already part of server then should be removed when upgrade is done to 10.3. It should be handled part of server or mysql_upgrade.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.31-MariaDB-log MariaDB Server
 
MariaDB [(none)]> INSTALL SONAME 'semisync_master';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> INSTALL SONAME 'semisync_slave';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> SELECT * FROM mysql.plugin;
+----------------------+--------------------+
| name                 | dl                 |
+----------------------+--------------------+
| rpl_semi_sync_master | semisync_master.so |
| rpl_semi_sync_slave  | semisync_slave.so  |
+----------------------+--------------------+

From here, I tried to upgrade from 10.2 to 10.3

# rpm -qa | egrep -i "mysql|mariadb"
MariaDB-common-10.3.22-1.el7.centos.x86_64
MariaDB-backup-10.3.22-1.el7.centos.x86_64
MariaDB-client-10.3.22-1.el7.centos.x86_64
MariaDB-server-10.3.22-1.el7.centos.x86_64
MariaDB-compat-10.2.31-1.el7.centos.x86_64
MariaDB-shared-10.3.22-1.el7.centos.x86_64
 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.22-MariaDB-log MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> SELECT * FROM mysql.plugin;
+-----------------------+--------------------------+
| name                  | dl                       |
+-----------------------+--------------------------+
| rpl_semi_sync_master  | semisync_master.so       |
| rpl_semi_sync_slave   | semisync_slave.so        |
+-----------------------+--------------------------+

As you can see reference to semi_sync plugins still present in mysql.plugin table after upgrade.

# mysql_upgrade
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
performance_schema
test
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
MariaDB [(none)]> SELECT * FROM mysql.plugin;
+-----------------------+--------------------------+
| name                  | dl                       |
+-----------------------+--------------------------+
| rpl_semi_sync_master  | semisync_master.so       |
| rpl_semi_sync_slave   | semisync_slave.so        |
+-----------------------+--------------------------+



 Comments   
Comment by Elena Stepanova [ 2020-03-07 ]

serg, how do you want it to be handled?

It's not this straightforward. Technically (even though it's unlikely), users can have their own custom plugins called the same way and installed in their instance, so just blindly removing them from the plugin table can cause unexpected effects.

Comment by Sergei Golubchik [ 2020-03-26 ]

I suppose we can remove rpl_semi_sync_master and/or rpl_semi_sync_slave if they don't load anymore?

Like, in mysql_upgrade check INFORMATION_SCHEMA.PLUGINS and if semisync plugins aren't there, delete them from mysql.plugin.

Comment by Rucha Deodhar [ 2022-03-25 ]

Patch: https://github.com/MariaDB/server/commit/549a71e74b2fa494efcd79635a5db8af0d541f99

Comment by Sergei Golubchik [ 2022-03-25 ]

549a71e74b2f is ok to push

Generated at Thu Feb 08 09:10:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.