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

thread IDs are printed in different formats in different sections of SHOW ENGINE INNODB STATUS output

Details

    Description

      SHOW ENGINE INNODB STATUS uses different formats to print thread IDs in different sections of the output.

      For example, the thread IDs are in decimal in the SEMAPHORES section:

      ----------
      SEMAPHORES
      ----------
      OS WAIT ARRAY INFO: reservation count 518859705
      --Thread 140189784869632 has waited at lock0lock.cc line 5636 for 0.0000 seconds the semaphore:
      Mutex at 0x7f8859c88068 '&lock_sys->mutex', lock var 1
      Last time reserved by thread 139857189899008 in file not yet reserved line 0, waiters flag 0
      wait has ended
      

      We can see that this semaphore is held by a thread with ID 139857189899008. To find that thread in the TRANSACTIONS section, we have to convert it to hex. This value in hex is 7F330A1F8B00. This conversion allows us to find the relevant transaction:

      ---TRANSACTION 2284134567, ACTIVE 724 sec unlock_row
      mysql tables in use 2, locked 1
      2649 lock struct(s), heap size 407080, 1 row lock(s)
      MySQL thread id 207695, OS thread handle 0x7f330a1f8b00, query id 41767441 10.1.1.31 appuser Sending data
      UPDATE ...
      

      The main thread ID is also in decimal:

      Main thread process no. 13593, id 140188351182592, state: sleeping
      

      It might be worthwhile to change the output to be more consistent, so that users don't have to do decimal to hex conversions, and vice-versa. If not, then we should at least document this inconsistency.

      https://mariadb.com/kb/en/library/show-engine-innodb-status/

      Attachments

        Issue Links

          Activity

            hholzgra pointed out that the format used for these thread IDs should also be consistent with thread IDs printed outside of SHOW ENGINE INNODB STATUS as well. For example, in Galera's "BF lock wait long" messages, it currently seems to print the "OS thread handle" value in decimal:

            2020-08-06  0:29:04 0 [Note] InnoDB: WSREP: BF lock wait long for trx:0xdf2d1f469 query: ...
            TRANSACTION 59908420713, ACTIVE 1229 sec starting index read
            mysql tables in use 1, locked 1
            LOCK WAIT 2 lock struct(s), heap size 1128, 1 row lock(s)
            MySQL thread id 109, OS thread handle 139618489706240, query id 14973726334 Update_rows_log_event::find_row(28013568636)
            ...
            2020-08-06  0:29:04 109 [Note] InnoDB: WSREP: BF lock wait long for trx:0xdf2d1f469 query: ...
            TRANSACTION 59908420713, ACTIVE 1229 sec starting index read
            mysql tables in use 1, locked 1
            2 lock struct(s), heap size 1128, 1 row lock(s)
            MySQL thread id 109, OS thread handle 139618489706240, query id 14973726334 Update_rows_log_event::find_row(28013568636)
            ...
            

            GeoffMontee Geoff Montee (Inactive) added a comment - hholzgra pointed out that the format used for these thread IDs should also be consistent with thread IDs printed outside of SHOW ENGINE INNODB STATUS as well. For example, in Galera's "BF lock wait long" messages, it currently seems to print the "OS thread handle" value in decimal: 2020-08-06 0:29:04 0 [Note] InnoDB: WSREP: BF lock wait long for trx:0xdf2d1f469 query: ... TRANSACTION 59908420713, ACTIVE 1229 sec starting index read mysql tables in use 1, locked 1 LOCK WAIT 2 lock struct(s), heap size 1128, 1 row lock(s) MySQL thread id 109, OS thread handle 139618489706240, query id 14973726334 Update_rows_log_event::find_row(28013568636) ... 2020-08-06 0:29:04 109 [Note] InnoDB: WSREP: BF lock wait long for trx:0xdf2d1f469 query: ... TRANSACTION 59908420713, ACTIVE 1229 sec starting index read mysql tables in use 1, locked 1 2 lock struct(s), heap size 1128, 1 row lock(s) MySQL thread id 109, OS thread handle 139618489706240, query id 14973726334 Update_rows_log_event::find_row(28013568636) ...

            People

              vlad.lesin Vladislav Lesin
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              5 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.