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

THREADPOOL - Create Information Schema Table for Threadpool

    XMLWordPrintable

    Details

      Description

      Based on oracle information schema for thread pool, we should create some information schemas for mariadb thread pool

      In this MDEV we will work with unix implementation only, the windows implementation is another MDEV (MDEV-5046)

      more information here:
      https://lists.launchpad.net/maria-developers/msg06277.html

      -----------------
      first idea:
      here a start point based on mikael blog:
      http://mikaelronstrom.blogspot.com.br/2011_10_01_archive.html

      and something that i think is a start point based on maillist maria-discuss

      CREATE TABLE information_schema.THREAD_POOL(
        thread_pool_group BIGINT NOT NULL DEFAULT 0,
        thread_id BIGINT NOT NULL DEFAULT 0, (that's not the THD->thread_id variable, it's the real system thread, maybe a listerner, a worker or a work queue (is work queue a thread?) )
        work ENUM('listener','worker','queue') NOT NULL DEFAULT 'queue', (this show what this thread do in this thread pool group)
        connection_id BIGINT DEFAULT 0, (that's the THD->thread_id variable)
       
      others columns? maybe timeouts and others informations from internall scheduller? maybe timers for windows or others vars... must check the scheduller code
      )

      from mail list:

      Hi Roberto,
       
      The structures you need are in sql/threadpool_unix.cc
      Global all_groups array contains  all thread groups . Every thread_group_t has list of waiting threads , called “waiting_threads”,  and queue of not yet handled requests, called “queue” (request is represented by connection_t ), a listener  etc.
       
      “Active” connections, i.e connections that currently are executing queries , can neither  be found in threadpool’s waiting_threads, nor there is a different “active” list for them. So you may want to introduce special handling for those (i.e iterate the global “threads” list looking for active connections, get corresponding connection_t* struct from thd->event_scheduler.data, and do something with it, e.g look which thread group it belongs)
       
      On Windows,  I doubt you can implement any information_schema plugin for the threadpool. This is because threadpool is native OS threadpool, and OS structure representing it  PTP_POOL structure is opaque, and there is not much info you can extract from it (well, maybe you can , if you debug with a kernel debugger, but not otherwise)
       
      Wlad

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wlad Vladislav Vaintroub
              Reporter:
              rspadim roberto spadim
              Votes:
              2 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.