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

MyRocks-Gap-Lock: lock wait doesn't set correct STATE

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • 10.2(EOL)
    • OTHER
    • None

    Description

      When a query is waiting for row lock, it does not have waiting for row lock status in I_S.PROCESSLIST.

      This is a property of TokuDB, as well. Example of a TokuDB query waiting for a row lock:

                   ID: 8
                 USER: root
                 HOST: localhost
                   DB: test
              COMMAND: Query
                 TIME: 3
                STATE: Statistics
                 INFO: select * from t1 where pk=1 for update
              TIME_MS: 3683.455
                STAGE: 0
            MAX_STAGE: 0
             PROGRESS: 0.000
          MEMORY_USED: 78480
      MAX_MEMORY_USED: 80488
        EXAMINED_ROWS: 0
             QUERY_ID: 20
          INFO_BINARY: select * from t1 where pk=1 for update
                  TID: 30172
      

      Attachments

        Issue Links

          Activity

            It's the same in Percona Server

            mysql> select * from information_schema.processlist\G
            *************************** 1. row ***************************
                       ID: 3
                     USER: root
                     HOST: localhost
                       DB: test
                  COMMAND: Query
                     TIME: 6
                    STATE: statistics
                     INFO: select * from t10 where pk=2 for update
                  TIME_MS: 6724
                ROWS_SENT: 0
            ROWS_EXAMINED: 0
            

            psergei Sergei Petrunia added a comment - It's the same in Percona Server mysql> select * from information_schema.processlist\G *************************** 1. row *************************** ID: 3 USER: root HOST: localhost DB: test COMMAND: Query TIME: 6 STATE: statistics INFO: select * from t10 where pk=2 for update TIME_MS: 6724 ROWS_SENT: 0 ROWS_EXAMINED: 0

            Well, one can observe TokuDB lock waits with tokudb_lock_waits table:

            MariaDB [j1]> select * from information_schema.TokuDB_lock_waits\G
            *************************** 1. row ***************************
                           requesting_trx_id: 95
                             blocking_trx_id: 93
                            lock_waits_dname: ./j1/t10-main
                         lock_waits_key_left: ff01000000
                        lock_waits_key_right: 0101000000
                       lock_waits_start_time: 1546543046850
                     lock_waits_table_schema: j1
                       lock_waits_table_name: t10
            lock_waits_table_dictionary_name: main
            

            There is also TokuDB_trx table which maps Toku's transaction id to mysql connection id:

            MariaDB [j1]> select * from information_schema.TokuDB_trx\G
            *************************** 1. row ***************************
                         trx_id: 93
            trx_mysql_thread_id: 10
                       trx_time: 435
            *************************** 2. row ***************************
                         trx_id: 95
            trx_mysql_thread_id: 11
                       trx_time: 314
            2 rows in set (0.002 sec)
            

            psergei Sergei Petrunia added a comment - Well, one can observe TokuDB lock waits with tokudb_lock_waits table: MariaDB [j1]> select * from information_schema.TokuDB_lock_waits\G *************************** 1. row *************************** requesting_trx_id: 95 blocking_trx_id: 93 lock_waits_dname: ./j1/t10-main lock_waits_key_left: ff01000000 lock_waits_key_right: 0101000000 lock_waits_start_time: 1546543046850 lock_waits_table_schema: j1 lock_waits_table_name: t10 lock_waits_table_dictionary_name: main There is also TokuDB_trx table which maps Toku's transaction id to mysql connection id: MariaDB [j1]> select * from information_schema.TokuDB_trx\G *************************** 1. row *************************** trx_id: 93 trx_mysql_thread_id: 10 trx_time: 435 *************************** 2. row *************************** trx_id: 95 trx_mysql_thread_id: 11 trx_time: 314 2 rows in set (0.002 sec)

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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