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

safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables', or of mutex 'LOCK_global_system_variables' and 'LOCK_log', on setting max_binlog_size or binlog_checksum and START TRANSACTION

Details

    Description

      # mysqld options required for replay: --log-bin
      SET GLOBAL max_binlog_size=98304;  # A valid and arbritary setting
      START TRANSACTION WITH CONSISTENT SNAPSHOT;
      

      Leads to:

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
      

      And

      # mysqld options required for replay: --log-bin
      START TRANSACTION WITH CONSISTENT SNAPSHOT;
      SET GLOBAL max_binlog_size=98304;  # A valid and arbritary setting
      

      Leads to:

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log'
      

      Bug confirmed present in:
      MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar created issue -
            Roel Roel Van de Paar made changes -
            Field Original Value New Value
            Labels mutex
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            Bug confirmed present in:


            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.3 (dbg), 10.9.3 (opt), 10.10.2 (dbg), 10.10.2 (opt), 10.11.0 (dbg), 10.11.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)
            {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.0 (opt)
            Roel Roel Van de Paar made changes -
            Summary safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables' on START TRANSACTION safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables', or of mutex 'LOCK_global_system_variables' and 'LOCK_log', on setting max_binlog_size and START TRANSACTION
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.0 (opt)
            {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            And

            {code:sql}
            # mysqld options required for replay: --log-bin
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            {code}

            Leads to:
            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log'
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.0 (opt)
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            And

            {code:sql}
            # mysqld options required for replay: --log-bin
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            {code}

            Leads to:
            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log'
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.0 (opt)
            {code:sql}
            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            {code}

            Leads to:

            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            {noformat}

            And

            {code:sql}
            # mysqld options required for replay: --log-bin
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            SET GLOBAL max_binlog_size=98304; # A valid and arbritary setting
            {code}

            Leads to:
            {noformat:title=10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)}
            safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log'
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.3 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

            Also with binlog_checksum, as in

            --source include/have_innodb.inc
            --source include/have_log_bin.inc
             
            SET GLOBAL binlog_checksum= CRC32;
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            

            The problem is old though.

            elenst Elena Stepanova added a comment - Also with binlog_checksum , as in --source include/have_innodb.inc --source include/have_log_bin.inc   SET GLOBAL binlog_checksum= CRC32; START TRANSACTION WITH CONSISTENT SNAPSHOT; The problem is old though.
            Roel Roel Van de Paar added a comment - - edited

            Was able to catch a bit more info with this testcase

            # mysqld options required for replay: --log-bin
            SET GLOBAL max_binlog_size=0;
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            

            10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

            safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables'
            Mutex currently locked (in reverse order):
            LOCK_global_system_variables      /test/10.11_dbg/sql/sql_plugin.cc  line 3096
            LOCK_commit_ordered               /test/10.11_dbg/sql/handler.cc  line 3007
            

            Same source code line numbers for the testcase by elenst (with thanks!)

            Roel Roel Van de Paar added a comment - - edited Was able to catch a bit more info with this testcase # mysqld options required for replay: --log-bin SET GLOBAL max_binlog_size=0; START TRANSACTION WITH CONSISTENT SNAPSHOT; 10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug) safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables' Mutex currently locked (in reverse order): LOCK_global_system_variables /test/10.11_dbg/sql/sql_plugin.cc line 3096 LOCK_commit_ordered /test/10.11_dbg/sql/handler.cc line 3007 Same source code line numbers for the testcase by elenst (with thanks!)
            Roel Roel Van de Paar made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.7 [ 24805 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.3 [ 22126 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.8 [ 26121 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.10 [ 27530 ]
            Roel Roel Van de Paar added a comment - - edited

            Also please try:

            # mysqld options required for replay: --log-bin
            START TRANSACTION WITH CONSISTENT SNAPSHOT;
            FLUSH LOGS;
            SET GLOBAL binlog_checksum=NONE;
            

            11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug)

            2023-12-07 15:08:21 0 [Note] /test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd: ready for connections.
            Version: '11.3.0-MariaDB-debug-log'  socket: '/test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/socket.sock'  port: 10415  MariaDB Server
            2023-12-07 15:08:21 6 [Note] Start binlog_dump to slave_server(2), pos(, 4), using_gtid(1), gtid('')
            safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log'
            Mutex currently locked (in reverse order):
            LOCK_log                          /test/11.3_dbg/sql/log.cc  line 12235
            LOCK_global_system_variables      /test/11.3_dbg/sql/sys_vars_shared.h  line 56
            

            Roel Roel Van de Paar added a comment - - edited Also please try: # mysqld options required for replay: --log-bin START TRANSACTION WITH CONSISTENT SNAPSHOT; FLUSH LOGS; SET GLOBAL binlog_checksum=NONE; 11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug) 2023-12-07 15:08:21 0 [Note] /test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd: ready for connections. Version: '11.3.0-MariaDB-debug-log' socket: '/test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/socket.sock' port: 10415 MariaDB Server 2023-12-07 15:08:21 6 [Note] Start binlog_dump to slave_server(2), pos(, 4), using_gtid(1), gtid('') safe_mutex: Found wrong usage of mutex 'LOCK_global_system_variables' and 'LOCK_log' Mutex currently locked (in reverse order): LOCK_log /test/11.3_dbg/sql/log.cc line 12235 LOCK_global_system_variables /test/11.3_dbg/sql/sys_vars_shared.h line 56
            Roel Roel Van de Paar made changes -
            Labels mutex affects-tests mutex
            Roel Roel Van de Paar made changes -
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Affects Version/s 11.0 [ 28320 ]
            Affects Version/s 11.1 [ 28549 ]
            Affects Version/s 11.2 [ 28603 ]
            Affects Version/s 11.3 [ 28565 ]
            Affects Version/s 11.4 [ 29301 ]
            Roel Roel Van de Paar made changes -
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.3 [ 28565 ]
            Roel Roel Van de Paar added a comment - - edited

            # mysqld options required for replay: --log-bin 
            SET GLOBAL binlog_checksum=DEFAULT;
            START TRANSACTION WITH CONSISTENT SNAPSHOT,READ WRITE;
            

            safe_mutex: Found wrong usage of mutex LOCK_commit_ordered and LOCK_global_system_variables
            

            Roel Roel Van de Paar added a comment - - edited # mysqld options required for replay: --log-bin SET GLOBAL binlog_checksum= DEFAULT ; START TRANSACTION WITH CONSISTENT SNAPSHOT, READ WRITE; safe_mutex: Found wrong usage of mutex LOCK_commit_ordered and LOCK_global_system_variables

            Elkin Hi! Would you have a moment to check how serious this issue is under the hood? Thank you

            Roel Roel Van de Paar added a comment - Elkin Hi! Would you have a moment to check how serious this issue is under the hood? Thank you
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.3 [ 28565 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.4 [ 22408 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.1 [ 28549 ]
            Roel Roel Van de Paar made changes -
            Affects Version/s 11.7 [ 29815 ]
            Roel Roel Van de Paar made changes -
            Comment [ {code:sql}
            # mysqld options required for replay: --log_bin
            SET GLOBAL binlog_checksum=0;
            INSTALL SONAME 'ha_spider';
            RESET MASTER;
            {code}
            Leads to:
            {noformat:title=CS 11.7.0 4016c905cbabea7f29ed282dc2125254c7c0d419 (Debug)}
            Version: '11.7.0-MariaDB-debug-log' socket: '/test/MD141024-mariadb-11.7.0-linux-x86_64-dbg/socket.sock' port: 12847 MariaDB Server
            safe_mutex: Found wrong usage of mutex 'LOCK_log' and 'LOCK_global_system_variables'
            Mutex currently locked (in reverse order):
            LOCK_global_system_variables /test/11.7_dbg/sql/sql_plugin.cc line 3132
            LOCK_log /test/11.7_dbg/sql/log.cc line 4449
            {noformat}
            MTR Testcase:
            {code:sql}
            --source include/have_log_bin.inc
            SET GLOBAL binlog_checksum=0;
            INSTALL SONAME 'ha_spider';
            RESET MASTER;
            {code}
            Note the different testcase and reversed wrong mutex usage detection order. ]
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Affects Version/s 11.6 [ 29515 ]
            Roel Roel Van de Paar made changes -
            Fix Version/s 11.4 [ 29301 ]
            Fix Version/s 11.6 [ 29515 ]
            Roel Roel Van de Paar made changes -
            Summary safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables', or of mutex 'LOCK_global_system_variables' and 'LOCK_log', on setting max_binlog_size and START TRANSACTION safe_mutex: Found wrong usage of mutex 'LOCK_commit_ordered' and 'LOCK_global_system_variables', or of mutex 'LOCK_global_system_variables' and 'LOCK_log', on setting max_binlog_size or binlog_checksum and START TRANSACTION
            knielsen Kristian Nielsen made changes -
            Assignee Andrei Elkin [ elkin ] Kristian Nielsen [ knielsen ]
            knielsen Kristian Nielsen made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            knielsen Kristian Nielsen made changes -

            The same problem will probably also occur for max_binlog_total_size, which is available since 11.4.

            knielsen Kristian Nielsen added a comment - The same problem will probably also occur for max_binlog_total_size, which is available since 11.4.
            elenst Elena Stepanova added a comment - - edited

            Sure. It would be recognized as a known bug (this one) and ignored in tests.

            elenst Elena Stepanova added a comment - - edited Sure. It would be recognized as a known bug (this one) and ignored in tests.
            knielsen Kristian Nielsen made changes -
            Assignee Kristian Nielsen [ knielsen ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            knielsen Hi! Thank you for working on this. I see you put this in review but I cannot see an attached patch?

            Roel Roel Van de Paar added a comment - knielsen Hi! Thank you for working on this. I see you put this in review but I cannot see an attached patch?

            The patch is in branch bb-10.6-knielsen

            knielsen Kristian Nielsen added a comment - The patch is in branch bb-10.6-knielsen
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.6(EOL) [ 29515 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.2(EOL) [ 28603 ]

            sergLet me know if you're going to review this week, otherwise I'll just take it back and push it with your suggestion to use mysql_mutex_record_order()

            knielsen Kristian Nielsen added a comment - serg Let me know if you're going to review this week, otherwise I'll just take it back and push it with your suggestion to use mysql_mutex_record_order()

            I was going to review it in about 2-3 weeks (note that the release is planned for the end of Jan)

            serg Sergei Golubchik added a comment - I was going to review it in about 2-3 weeks (note that the release is planned for the end of Jan)
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Kristian Nielsen [ knielsen ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            knielsen Kristian Nielsen made changes -
            Fix Version/s 10.5 [ 23123 ]
            knielsen Kristian Nielsen added a comment - Pushed to 10.6. Requires another patch when merged to 11.4, see here: https://lists.mariadb.org/hyperkitty/list/developers@lists.mariadb.org/thread/LN35WETUEUHYUQNZXAKXLVU5EGSCQSVX/
            knielsen Kristian Nielsen made changes -
            Fix Version/s 10.6.21 [ 29953 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.4 [ 29301 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]

            People

              knielsen Kristian Nielsen
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.