Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21873

10.2 to 10.3 upgrade doesn't remove semi-sync reference from mysql.plugin table

Details

    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        |
      +-----------------------+--------------------------+
      

      Attachments

        Issue Links

          Activity

            muhammad.irfan Muhammad Irfan created issue -
            muhammad.irfan Muhammad Irfan made changes -
            Field Original Value New Value
            Priority Major [ 3 ] Critical [ 2 ]
            muhammad.irfan Muhammad Irfan made changes -
            Description I noticed that upgrade from 10.2 -> 10.3 doesn't remove semi-sync reference from mysql.plugin table. As per documentation:

            {quote}
            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.
            {quote}

            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.

            {code}
            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 |
            +----------------------+--------------------+
            {code}

            From here, I tried to upgrade from 10.2 to 10.3

            {code}
            # 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 |
            +-----------------------+--------------------------+
            {code}

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

            {code}
            # 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 |
            +-----------------------+--------------------------+
            {code}
            I noticed that upgrade from 10.2 -> 10.3 doesn't remove semi-sync reference from mysql.plugin table. As per documentation:

            {quote}
            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.
            {quote}

            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.

            {code}
            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 |
            +----------------------+--------------------+
            {code}

            From here, I tried to upgrade from 10.2 to 10.3

            {code}
            # 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 |
            +-----------------------+--------------------------+
            {code}

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

            {code}
            # 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 |
            +-----------------------+--------------------------+
            {code}
            Summary upgrade to 10.3 from 10.2 doesn't remove semi-sync plugin reference from mysql.plugin table `1
            nicklamb Nick (Inactive) made changes -
            Summary `1 10.2 to 10.3 Upgrade doesn't remove
            nicklamb Nick (Inactive) made changes -
            Summary 10.2 to 10.3 Upgrade doesn't remove 10.2 to 10.3 upgrade doesn't remove semi-sync reference from mysql.plugin table

            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.

            elenst Elena Stepanova added a comment - 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.
            elenst Elena Stepanova made changes -
            Component/s Plugins [ 10118 ]
            Component/s Scripts & Clients [ 11002 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            Assignee Sergei Golubchik [ serg ]

            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.

            serg Sergei Golubchik added a comment - 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.
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            serg Sergei Golubchik made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            GeoffMontee Geoff Montee (Inactive) made changes -
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Alexey Botchkov [ holyfoot ]
            serg Sergei Golubchik made changes -
            Assignee Alexey Botchkov [ holyfoot ] Oleksandr Byelkin [ sanja ]
            julien.fritsch Julien Fritsch made changes -
            Labels need_feedback
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 104571 ] MariaDB v4 [ 141819 ]
            julien.fritsch Julien Fritsch made changes -
            Status Open [ 1 ] Needs Feedback [ 10501 ]
            julien.fritsch Julien Fritsch made changes -
            Labels need_feedback
            muhammad.irfan Muhammad Irfan made changes -
            Status Needs Feedback [ 10501 ] Open [ 1 ]
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            julien.fritsch Julien Fritsch made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Rucha Deodhar [ rucha174 ]
            rucha174 Rucha Deodhar made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            rucha174 Rucha Deodhar added a comment - Patch: https://github.com/MariaDB/server/commit/549a71e74b2fa494efcd79635a5db8af0d541f99
            rucha174 Rucha Deodhar made changes -
            Assignee Rucha Deodhar [ rucha174 ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            549a71e74b2f is ok to push

            serg Sergei Golubchik added a comment - 549a71e74b2f is ok to push
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Rucha Deodhar [ rucha174 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            rucha174 Rucha Deodhar made changes -
            Fix Version/s 10.3.35 [ 27512 ]
            Fix Version/s 10.4.25 [ 27510 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201074 193709

            People

              rucha174 Rucha Deodhar
              muhammad.irfan Muhammad Irfan
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.