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

SET GLOBAL innodb_ deadlock due to LOCK_global_system_variables

    XMLWordPrintable

Details

    Description

      The ‘update’ callback functions for several settable global InnoDB variables are acquiring InnoDB latches while holding LOCK_global_system_variables.

      On the other hand, some InnoDB code is invoking THDVAR() while holding InnoDB latches. An example of this is thd_lock_wait_timeout() that is called by lock_rec_enqueue_waiting(). In some cases, the intern_sys_var_ptr() that is invoked by THDVAR() may acquire LOCK_global_system_variables, via invoking sync_dynamic_session_variables().

      In lock_rec_enqueue_waiting(), we really must be holding some InnoDB latch while invoking THDVAR(). This implies that LOCK_global_system_variables must conceptually reside below any InnoDB latch in the latching order. That in turns implies that the various ‘update’ callback functions must release LOCK_global_system_variables before acquiring any InnoDB mutexes or rw-locks, and reacquire LOCK_global_system_variables later. The ‘validate’ functions are not being invoked while holding LOCK_global_system_variables and thus they do not need any changes.

      The following statements are affected by this:

      SET GLOBAL innodb_adaptive_hash_index = …;
      SET GLOBAL innodb_cmp_per_index_enabled = 1;
      SET GLOBAL innodb_old_blocks_pct = …;
      SET GLOBAL innodb_fil_make_page_dirty_debug = …; -- debug builds only
      SET GLOBAL innodb_buffer_pool_evict = uncompressed; -- debug builds only
      SET GLOBAL innodb_purge_run_now = 1; -- debug builds only
      SET GLOBAL innodb_purge_stop_now = 1; -- debug builds only
      SET GLOBAL innodb_log_checkpoint_now = 1; -- debug builds only
      SET GLOBAL innodb_buf_flush_list_now = 1; -- debug builds only
      SET GLOBAL innodb_buffer_pool_dump_now = 1;
      SET GLOBAL innodb_buffer_pool_load_now = 1;
      SET GLOBAL innodb_buffer_pool_load_abort = 1;
      SET GLOBAL innodb_status_output = …;
      SET GLOBAL innodb_status_output_locks = …;
      SET GLOBAL innodb_encryption_threads = …;
      SET GLOBAL innodb_encryption_rotate_key_age = …;
      SET GLOBAL innodb_encryption_rotation_iops = …;
      SET GLOBAL innodb_encrypt_tables = …;
      SET GLOBAL innodb_disallow_writes = …;
      

      Attachments

        Activity

          People

            marko Marko Mäkelä
            marko Marko Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.