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

P_S.THREADS is not showing all server threads

Details

    Description

      While actually trying to analyze something else I found that PERFORMANCE_SCHEMA.THREADS does not list all server threads.

      In my case I was originally looking for InnoDB background encryption threads, of which I had four configured, but found that there were actually five threads missing.

      ps showed:

      $ pgrep -w mariadbd | xargs ps -Lo pid,lwp,cmd
          PID     LWP CMD
        14728   14728 /usr/sbin/mariadbd
        14728   14729 /usr/sbin/mariadbd
        14728   14730 /usr/sbin/mariadbd
        14728   14731 /usr/sbin/mariadbd
        14728   14732 /usr/sbin/mariadbd
        14728   14735 /usr/sbin/mariadbd
        14728   14736 /usr/sbin/mariadbd
        14728   14737 /usr/sbin/mariadbd
        14728   14738 /usr/sbin/mariadbd
        14728   14739 /usr/sbin/mariadbd
        14728   14740 /usr/sbin/mariadbd
        14728   14742 /usr/sbin/mariadbd
        14728   15299 /usr/sbin/mariadbd
        14728   15383 /usr/sbin/mariadbd
      

      But the THREADS table only had:

      MariaDB [test]> select name, thread_os_id from performance_schema.threads order by thread_os_id;
      +-----------------------------------+--------------+
      | name                              | thread_os_id |
      +-----------------------------------+--------------+
      | thread/sql/main                   |        14728 |
      | thread/mysys/statement_timer      |        14729 |
      | thread/aria/checkpoint_background |        14730 |
      | thread/innodb/page_cleaner_thread |        14732 |
      | thread/sql/manager                |        14739 |
      | thread/sql/binlog_background      |        14740 |
      | thread/sql/signal_handler         |        14742 |
      | thread/innodb/thread_pool_thread  |        15299 |
      | thread/sql/one_connection         |        15383 |
      +-----------------------------------+--------------+
      

      So LWP ides 14731 and 14835-14738 were missing. The later four are the background encryption threads, and 14731 was running this according to gdb:

      Thread 4 (Thread 0x7fa945118700 (LWP 14731)):
      #0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
      #1  0x000055faa5f1213d in my_getevents (min_nr=1, nr=256, ev=0x7fa945115d60, ctx=<optimized out>) at ./tpool/aio_linux.cc:105
      #2  tpool::aio_linux::getevent_thread_routine (aio=0x55faa8c4e650) at ./tpool/aio_linux.cc:105
      #3  0x00007fa96107bdf4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #4  0x00007fa961195609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #5  0x00007fa960d81353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Not sure whether it is only these threads that do not show, or whether there are also other candidates that were just not running in this setup to begin with.

      Attachments

        Issue Links

          Activity

            hholzgra Hartmut Holzgraefe created issue -
            JIraAutomate JiraAutomate made changes -
            Field Original Value New Value
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            serg Sergei Golubchik made changes -
            Assignee Marko Mäkelä [ marko ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 201553
            Zendesk active tickets 201553
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Vladislav Vaintroub [ wlad ]
            wlad Vladislav Vaintroub made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            wlad Vladislav Vaintroub made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            wlad Vladislav Vaintroub made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            wlad Vladislav Vaintroub made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            wlad Vladislav Vaintroub made changes -
            Assignee Vladislav Vaintroub [ wlad ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Vladislav Vaintroub [ wlad ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            wlad Vladislav Vaintroub made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            wlad Vladislav Vaintroub made changes -
            Assignee Vladislav Vaintroub [ wlad ] Marko Mäkelä [ marko ]
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2025-01-27 10:52:35.0 2025-01-27 10:52:34.939
            marko Marko Mäkelä made changes -
            Component/s Encryption [ 11200 ]
            Component/s Performance Schema [ 15627 ]
            Component/s Storage Engine - InnoDB [ 10129 ]
            Fix Version/s 10.5.28 [ 29952 ]
            Fix Version/s 10.6.21 [ 29953 ]
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]
            Fix Version/s 11.8.1 [ 29961 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            oli Oli Sennhauser made changes -

            People

              marko Marko Mäkelä
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.