Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring the Aria two-step deadlock detection


A deadlock is when there are two competing actions and both are waiting for the other to finish and so neither of them ever finish. The Aria storage engine is able to automatically detect and deal with deadlocks. To make effective use of this feature, we should configure it with the settings that work well for our needs.

How to do it...

  1. Run the following command to show the current settings for Aria's two-step deadlock detection:

    SHOW VARIABLES LIKE 'deadlock_%'\G
    
  2. If our settings are set to the default values, the output of the previous command will be as shown in the following screenshot:

  3. Change the variables to our desired values, as follows:

    SET GLOBAL deadlock_search_depth_short = 3;
    SET GLOBAL deadlock_search_depth_long = 10;
    SET GLOBAL deadlock_timeout_long = 10000000;
    SET GLOBAL deadlock_timeout_short = 5000;
    
  4. Make the changes permanent by adding the following lines of code to the bottom of our my.cnf or my.ini file (or to an existing ...