[MDEV-5019] THREADPOOL - Create Information Schema Table for Threadpool Created: 2013-09-16  Updated: 2019-10-16  Resolved: 2019-10-16

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: N/A

Type: Task Priority: Minor
Reporter: roberto spadim Assignee: Vladislav Vaintroub
Resolution: Duplicate Votes: 2
Labels: threadpool

Attachments: Text File threadpool_info.cc    
Issue Links:
Duplicate
duplicates MDEV-19313 Threadpool : provide information sche... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MDEV-5046 THREADPOOL - information schema for w... Technical task Closed Vladislav Vaintroub  

 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



 Comments   
Comment by roberto spadim [ 2013-09-21 ]

first step =)

Comment by roberto spadim [ 2013-09-21 ]

second step =)

Comment by roberto spadim [ 2013-10-06 ]

hi guys, could anyone help me with the TODO parts of patch?

Comment by Geoff Montee (Inactive) [ 2019-10-16 ]

wlad, do you want to close this one as a duplicate of MDEV-19313?

Comment by Vladislav Vaintroub [ 2019-10-16 ]

Closing as duplicate of MDEV-19313

Generated at Thu Feb 08 07:01:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.