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

Set thread names for MariaDB Server threads

Details

    Description

      Multi-threaded Linux programs (like Firefox or MySQL since 8.0.27 or so) usually set a name for each thread. This name will appear in the output of top and other utilities and would help to answer questions like "What thread uses most of CPU" etc.

      Consider this example of MySQL 8.0.29:

      openxs@ao756:~/dbs/8.0$ for task in $(ls /proc/$(pidof mysqld)/task/); do name=$(cat /proc/$(pidof mysqld)/task/${task}/comm); echo "TASK: ${task} (${name})"; done
      TASK: 567049 (mysqld)
      TASK: 567079 (ib_io_ibuf)
      TASK: 567080 (ib_io_log)
      TASK: 567081 (ib_io_rd-1)
      TASK: 567082 (ib_io_rd-2)
      TASK: 567083 (ib_io_rd-3)
      TASK: 567084 (ib_io_rd-4)
      TASK: 567085 (ib_io_wr-1)
      TASK: 567086 (ib_io_wr-2)
      TASK: 567087 (ib_io_wr-3)
      TASK: 567088 (ib_io_wr-4)
      TASK: 567089 (ib_pg_flush_co)
      TASK: 567096 (ib_log_checkpt)
      TASK: 567097 (ib_log_fl_notif)
      TASK: 567098 (ib_log_flush)
      TASK: 567099 (ib_log_wr_notif)
      TASK: 567100 (ib_log_writer)
      TASK: 567114 (ib_srv_lock_to)
      TASK: 567115 (ib_srv_err_mon)
      TASK: 567116 (ib_srv_mon)
      TASK: 567117 (ib_buf_resize)
      TASK: 567118 (ib_src_main)
      TASK: 567119 (ib_dict_stats)
      TASK: 567120 (ib_fts_opt)
      TASK: 567122 (xpl_worker-1)
      TASK: 567123 (xpl_worker-2)
      TASK: 567124 (xpl_accept-1)
      TASK: 567893 (ib_buf_dump)
      TASK: 567894 (ib_clone_gtid)
      TASK: 567895 (ib_srv_purge)
      TASK: 567896 (ib_srv_wkr-1)
      TASK: 567897 (ib_srv_wkr-2)
      TASK: 567898 (ib_srv_wkr-3)
      TASK: 567899 (evt_sched)
      TASK: 567900 (sig_handler)
      TASK: 567902 (xpl_accept-3)
      TASK: 567903 (gtid_zip)
      

      For MariaDB (10.6 here for example) we get:

      openxs@ao756:~/dbs/maria10.6$ for task in $(ls /proc/$(pidof mariadbd)/task/); do name=$(cat /proc/$(pidof mariadbd)/task/${task}/comm); echo "TASK: ${task} (${name})"; done
      TASK: 568093 (mariadbd)
      TASK: 568095 (mariadbd)
      TASK: 568096 (mariadbd)
      TASK: 568097 (mariadbd)
      TASK: 568098 (mariadbd)
      TASK: 568099 (mariadbd)
      TASK: 568104 (mariadbd)
      TASK: 568105 (mariadbd)
      openxs@ao756:~/dbs/maria10.6$
      

      See also https://bugs.mysql.com/bug.php?id=70858

      It makes sense to use the same thread name as used in Performance Schema.

      Attachments

        Activity

          valerii Valerii Kravchuk created issue -
          wlad Vladislav Vaintroub made changes -
          Field Original Value New Value
          Assignee Vladislav Vaintroub [ wlad ]
          wlad Vladislav Vaintroub made changes -
          Fix Version/s 11.4 [ 29301 ]
          wlad Vladislav Vaintroub made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          wlad Vladislav Vaintroub made changes -
          Assignee Vladislav Vaintroub [ wlad ] Nikita Malyavin [ nikitamalyavin ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          nikitamalyavin Nikita Malyavin made changes -
          Assignee Nikita Malyavin [ nikitamalyavin ] Vladislav Vaintroub [ wlad ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Fix Version/s 11.5 [ 29506 ]
          Fix Version/s 11.4 [ 29301 ]
          wlad Vladislav Vaintroub made changes -
          Assignee Vladislav Vaintroub [ wlad ] Sergei Golubchik [ serg ]
          Status Stalled [ 10000 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 11.6 [ 29515 ]
          Fix Version/s 11.5 [ 29506 ]
          serg Sergei Golubchik made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Vladislav Vaintroub [ wlad ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          wlad Vladislav Vaintroub made changes -
          Status Stalled [ 10000 ] In Testing [ 10301 ]
          wlad Vladislav Vaintroub made changes -
          Assignee Vladislav Vaintroub [ wlad ] Lena Startseva [ JIRAUSER50478 ]
          serg Sergei Golubchik made changes -
          serg Sergei Golubchik made changes -
          Issue Type Task [ 3 ] New Feature [ 2 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Labels Preview_11.6
          lstartseva Lena Startseva made changes -
          Assignee Lena Startseva [ JIRAUSER50478 ] Vladislav Vaintroub [ wlad ]
          Status In Testing [ 10301 ] Stalled [ 10000 ]
          wlad Vladislav Vaintroub made changes -
          Attachment screenshot-1.png [ 73815 ]
          nikitamalyavin Nikita Malyavin made changes -
          Attachment screenshot-2.png [ 73818 ]
          wlad Vladislav Vaintroub made changes -
          issue.field.resolutiondate 2024-07-09 17:35:01.0 2024-07-09 17:35:01.187
          wlad Vladislav Vaintroub made changes -
          Component/s Server [ 13907 ]
          Fix Version/s 11.6.1 [ 29847 ]
          Fix Version/s 11.6 [ 29515 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]

          People

            wlad Vladislav Vaintroub
            valerii Valerii Kravchuk
            Votes:
            1 Vote for this issue
            Watchers:
            7 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.