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

LP:489088 - On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      As reported by Kristian:

      MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown

      The bug has been repeated with MariaDB: lp:~maria-captains/maria/5.1-merge

      Create a file "mysql-test/suite/pbxt/t/kn.test", with the following contents:

      ------------------------------ cut here ------------------------------
      --skip "Test shutdown problem with skipped test"
      ------------------------------ cut here ------------------------------

      Then enter:

      cd mysql-test
      perl mysql-test-run.pl --suite=pbxt pbxt.kn

      Kristian says:

      I get this in the mysqld.1.err:

      CURRENT_TEST: pbxt.kn
      091124 15:11:00 [Note] Plugin 'InnoDB' is disabled.
      091124 15:11:00 [Note] PrimeBase XT (PBXT) Engine 1.0.08d RC loaded...
      091124 15:11:00 [Note] Paul McCullagh, PrimeBase Technologies GmbH, http://www.primebase.org
      091124 15:11:00 [Note] Event Scheduler: Loaded 0 events
      091124 15:11:00 [Note] /home/knielsen/devel/maria/my/merge-5.1.41/sql/mysqld: ready for connections.
      Version: '5.1.41-mariadb-beta-valgrind-max-debug-log' socket: '/home/knielsen/devel/maria/my/merge-5.1.41/mysql-test/var/tmp/mysqld.1.sock' port: 13000 Source distribution
      091124 15:11:00 [Note] Got signal 15 to shutdown mysqld
      091124 15:11:00 [Note] /home/knielsen/devel/maria/my/merge-5.1.41/sql/mysqld: Normal shutdown

      091124 15:11:00 [Note] Event Scheduler: Purging the queue. 0 events
      091124 15:11:00 [Warning] Plugin 'MyISAM' will be forced to shutdown
      091124 15:11:00 [Warning] Plugin 'PBXT' will be forced to shutdown
      091124 15:11:00 [Note] PrimeBase XT Engine shutdown...
      091124 15:11:00 [Note] Debug sync points hit: 50
      091124 15:11:00 [Note] Debug sync points executed: 0
      091124 15:11:00 [Note] Debug sync points max active per thread: 0
      091124 15:11:00 [Note] /home/knielsen/devel/maria/my/merge-5.1.41/sql/mysqld: Shutdown complete

      This is from this tree on Launchpad containing the merge with MySQL 5.1.41:

      lp:~maria-captains/maria/5.1-merge

      The problem is that the ref_count of PBXT is 2 at shutdown time.

      Maybe this is another problem with the way that PBXT has to do init in a
      separate thread, I see you already had to solve some other possibly related
      problems. Any ideas? It may be that this is something introduced in the merge
      with MySQL 5.1.41, not 100% sure though as this particular warning was not
      detected before in our Buildbot tests...

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            vladimirkolesnikov Vladimir Kolesnikov added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            the problem happens when pbxt is the default storage engine. whenever a new thread starts (a thread that inits a THD instance) the following code is executed in function thd_init_vars or something like that (called from THD::THD):

            2456 pthread_mutex_lock(&LOCK_plugin);
            2457 thd->variables.table_plugin=
            2458 my_intern_plugin_lock(NULL, global_system_variables.table_plugin);
            2459 intern_plugin_unlock(NULL, old_table_plugin);

            the problem is that pbxt starts its own worker threads that init corresponding THD instances. In some sense pbxt locks itself. to solve this problem we'd need to make another 'background' plugin that would shutdown all pbxt worker threads or have 2-phase shutdown on server side.

            Show
            vladimirkolesnikov Vladimir Kolesnikov added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown the problem happens when pbxt is the default storage engine. whenever a new thread starts (a thread that inits a THD instance) the following code is executed in function thd_init_vars or something like that (called from THD::THD): 2456 pthread_mutex_lock(&LOCK_plugin); 2457 thd->variables.table_plugin= 2458 my_intern_plugin_lock(NULL, global_system_variables.table_plugin); 2459 intern_plugin_unlock(NULL, old_table_plugin); the problem is that pbxt starts its own worker threads that init corresponding THD instances. In some sense pbxt locks itself. to solve this problem we'd need to make another 'background' plugin that would shutdown all pbxt worker threads or have 2-phase shutdown on server side.
            Hide
            paulmccullagh Paul McCullagh added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            Maybe we could just immediately remove the reference, after creating the THD.

            After all, there is no danger of the plugin (PBXT) being removed, before the threads are shut down (and the THDs freed).

            Show
            paulmccullagh Paul McCullagh added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown Maybe we could just immediately remove the reference, after creating the THD. After all, there is no danger of the plugin (PBXT) being removed, before the threads are shut down (and the THDs freed).
            Hide
            vladimirkolesnikov Vladimir Kolesnikov added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            we must not do this when pbxt is not default engine. I will check to see if we have an easy way to detect this.

            Show
            vladimirkolesnikov Vladimir Kolesnikov added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown we must not do this when pbxt is not default engine. I will check to see if we have an easy way to detect this.
            Hide
            hakanküçükyılmaz Hakan Küçükyılmaz added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            Vladimir,

            what is the status of this bug? It seems like you have fixed it already.

            Best,

            Hakan

            Show
            hakanküçükyılmaz Hakan Küçükyılmaz added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown Vladimir, what is the status of this bug? It seems like you have fixed it already. Best, Hakan
            Hide
            paulmccullagh Paul McCullagh added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            This bug was fixed in PBXT 1.0.09f RC3 (2009-11-30)

            RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.

            Show
            paulmccullagh Paul McCullagh added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown This bug was fixed in PBXT 1.0.09f RC3 (2009-11-30) RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.
            Hide
            paulmccullagh Paul McCullagh added a comment -

            Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown
            This bug was fixed in PBXT 1.0.09f RC3 (2009-11-30), will be in MariaDB 5.1.46.

            RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.

            Show
            paulmccullagh Paul McCullagh added a comment - Re: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown This bug was fixed in PBXT 1.0.09f RC3 (2009-11-30), will be in MariaDB 5.1.46. RN291: Fixed bug #489088: On shutdown MySQL reports: [Warning] Plugin 'PBXT' will be forced to shutdown.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 489088

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 489088

              People

              • Assignee:
                Unassigned
                Reporter:
                paulmccullagh Paul McCullagh
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: