diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-07 14:50:01 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-07 14:50:01 +0200 |
commit | 48bb551328b004e91578d3d9e34f3837a3852f1e (patch) | |
tree | 427bb7f9c4e0e897f2a3b24642a07083f11816b3 | |
parent | 78c0642073a196dbba2fd82ba903b64a9f35ba3f (diff) | |
download | mariadb-git-48bb551328b004e91578d3d9e34f3837a3852f1e.tar.gz |
remove the service for installing the closed-source mysql thread pool plugin
-rw-r--r-- | include/mysql/plugin_audit.h.pp | 8 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h.pp | 8 | ||||
-rw-r--r-- | include/mysql/plugin_ftparser.h.pp | 8 | ||||
-rw-r--r-- | include/mysql/service_thread_scheduler.h | 65 | ||||
-rw-r--r-- | include/mysql/services.h | 4 | ||||
-rw-r--r-- | include/service_versions.h | 4 | ||||
-rw-r--r-- | libservices/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libservices/my_thread_scheduler_service.c | 20 | ||||
-rw-r--r-- | mysql-test/r/mysqld--help.result | 24 | ||||
-rw-r--r-- | mysql-test/t/mysqld--help.test | 2 | ||||
-rw-r--r-- | sql/scheduler.cc | 51 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 4 | ||||
-rw-r--r-- | sql/sql_plugin_services.h | 9 |
13 files changed, 35 insertions, 175 deletions
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp index fbd4ec2dd3f..2e74f8fd706 100644 --- a/include/mysql/plugin_audit.h.pp +++ b/include/mysql/plugin_audit.h.pp @@ -51,14 +51,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include <mysql/service_thread_scheduler.h> -struct scheduler_functions; -extern struct my_thread_scheduler_service { - int (*set)(struct scheduler_functions *scheduler); - int (*reset)(); -} *my_thread_scheduler_service; -int my_thread_scheduler_set(struct scheduler_functions *scheduler); -int my_thread_scheduler_reset(); #include <mysql/service_progress_report.h> extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp index 0f5dd26cfb3..6a877980c25 100644 --- a/include/mysql/plugin_auth.h.pp +++ b/include/mysql/plugin_auth.h.pp @@ -51,14 +51,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include <mysql/service_thread_scheduler.h> -struct scheduler_functions; -extern struct my_thread_scheduler_service { - int (*set)(struct scheduler_functions *scheduler); - int (*reset)(); -} *my_thread_scheduler_service; -int my_thread_scheduler_set(struct scheduler_functions *scheduler); -int my_thread_scheduler_reset(); #include <mysql/service_progress_report.h> extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp index 49cf7e5b931..ab15c9d176d 100644 --- a/include/mysql/plugin_ftparser.h.pp +++ b/include/mysql/plugin_ftparser.h.pp @@ -51,14 +51,6 @@ extern struct thd_wait_service_st { } *thd_wait_service; void thd_wait_begin(void* thd, int wait_type); void thd_wait_end(void* thd); -#include <mysql/service_thread_scheduler.h> -struct scheduler_functions; -extern struct my_thread_scheduler_service { - int (*set)(struct scheduler_functions *scheduler); - int (*reset)(); -} *my_thread_scheduler_service; -int my_thread_scheduler_set(struct scheduler_functions *scheduler); -int my_thread_scheduler_reset(); #include <mysql/service_progress_report.h> extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); diff --git a/include/mysql/service_thread_scheduler.h b/include/mysql/service_thread_scheduler.h deleted file mode 100644 index 5a5e0e2f520..00000000000 --- a/include/mysql/service_thread_scheduler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef SERVICE_THREAD_SCHEDULER_INCLUDED -#define SERVICE_THREAD_SCHEDULER_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif - -struct scheduler_functions; - -extern struct my_thread_scheduler_service { - int (*set)(struct scheduler_functions *scheduler); - int (*reset)(); -} *my_thread_scheduler_service; - -#ifdef MYSQL_DYNAMIC_PLUGIN - -#define my_thread_scheduler_set(F) my_thread_scheduler_service->set((F)) -#define my_thread_scheduler_reset() my_thread_scheduler_service->reset() - -#else - -/** - Set the thread scheduler to use for the server. - - @param scheduler Pointer to scheduler callbacks to use. - @retval 0 Scheduler installed correctly. - @retval 1 Invalid value (NULL) used for scheduler. -*/ -int my_thread_scheduler_set(struct scheduler_functions *scheduler); - -/** - Restore the previous thread scheduler. - - @note If no thread scheduler was installed previously with - thd_set_thread_scheduler, this function will report an error. - - @retval 0 Scheduler installed correctly. - @retval 1 No scheduler installed. -*/ -int my_thread_scheduler_reset(); - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */ diff --git a/include/mysql/services.h b/include/mysql/services.h index b5b331d4923..e14523f4fa1 100644 --- a/include/mysql/services.h +++ b/include/mysql/services.h @@ -1,5 +1,6 @@ #ifndef MYSQL_SERVICES_INCLUDED -/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. + Copyright (c) 2012, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +22,6 @@ extern "C" { #include <mysql/service_my_snprintf.h> #include <mysql/service_thd_alloc.h> #include <mysql/service_thd_wait.h> -#include <mysql/service_thread_scheduler.h> #include <mysql/service_progress_report.h> #include <mysql/service_debug_sync.h> #include <mysql/service_kill_statement.h> diff --git a/include/service_versions.h b/include/service_versions.h index 9b41da7440e..e0a717fea9e 100644 --- a/include/service_versions.h +++ b/include/service_versions.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. + Copyright (c) 2012, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +23,6 @@ #define VERSION_my_snprintf 0x0100 #define VERSION_thd_alloc 0x0100 #define VERSION_thd_wait 0x0100 -#define VERSION_my_thread_scheduler 0x0100 #define VERSION_progress_report 0x0100 #define VERSION_debug_sync 0x1000 #define VERSION_kill_statement 0x1000 diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt index 1583d1ff792..86ed3493993 100644 --- a/libservices/CMakeLists.txt +++ b/libservices/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006 MySQL AB, 2010 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006 MySQL AB, 2010 Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ SET(MYSQLSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c thd_wait_service.c - my_thread_scheduler_service.c progress_report_service.c debug_sync_service.c kill_statement_service.c) diff --git a/libservices/my_thread_scheduler_service.c b/libservices/my_thread_scheduler_service.c deleted file mode 100644 index 0bbad39dd0a..00000000000 --- a/libservices/my_thread_scheduler_service.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include <service_versions.h> -SERVICE_VERSION my_thread_scheduler_service= - (void*)VERSION_my_thread_scheduler; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index d29631eabc0..e5edb963ca9 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -817,6 +817,25 @@ The following options may be given as the first argument: values are COMMIT or ROLLBACK. --thread-cache-size=# How many threads we should keep in a cache for reuse + --thread-pool-idle-timeout=# + Timeout in seconds for an idle thread in the thread + pool.Worker thread will be shut down after timeout + --thread-pool-max-threads=# + Maximum allowed number of worker threads in the thread + pool + --thread-pool-oversubscribe=# + How many additional active worker threads in a group are + allowed. + --thread-pool-size=# + Number of thread groups in the pool. This parameter is + roughly equivalent to maximum number of concurrently + executing threads (threads in a waiting state do not + count as executing). + --thread-pool-stall-limit=# + Maximum query execution time in milliseconds,before an + executing non-yielding thread is considered stalled.If a + worker thread is stalled, additional worker thread may be + created to handle remaining clients. --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are @@ -1090,6 +1109,11 @@ table-definition-cache 400 table-open-cache 400 tc-heuristic-recover COMMIT thread-cache-size 0 +thread-pool-idle-timeout 60 +thread-pool-max-threads 500 +thread-pool-oversubscribe 3 +thread-pool-size 4 +thread-pool-stall-limit 500 thread-stack 294912 time-format %H:%i:%s timed-mutexes FALSE diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index 4b5572c2bbe..84d1fe85ec8 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -27,7 +27,7 @@ perl; feedback debug temp-pool ssl des-key-file xtradb thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph - sphinx thread-handling thread-pool query-cache-info/; + sphinx thread-handling query-cache-info/; # And substitute the content some environment variables with their # names: diff --git a/sql/scheduler.cc b/sql/scheduler.cc index 54653557b16..e690f06af2e 100644 --- a/sql/scheduler.cc +++ b/sql/scheduler.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2012, Monty Program Ab + Copyright (c) 2012, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -139,52 +139,3 @@ void one_thread_scheduler(scheduler_functions *func) func->end_thread= no_threads_end; } - - -/* - no pluggable schedulers in mariadb. - when we'll want it, we'll do it properly -*/ -#if 0 - -static scheduler_functions *saved_thread_scheduler; -static uint saved_thread_handling; - -extern "C" -int my_thread_scheduler_set(scheduler_functions *scheduler) -{ - DBUG_ASSERT(scheduler != 0); - - if (scheduler == NULL) - return 1; - - saved_thread_scheduler= thread_scheduler; - saved_thread_handling= thread_handling; - thread_scheduler= scheduler; - // Scheduler loaded dynamically - thread_handling= SCHEDULER_TYPES_COUNT; - return 0; -} - - -extern "C" -int my_thread_scheduler_reset() -{ - DBUG_ASSERT(saved_thread_scheduler != NULL); - - if (saved_thread_scheduler == NULL) - return 1; - - thread_scheduler= saved_thread_scheduler; - thread_handling= saved_thread_handling; - saved_thread_scheduler= 0; - return 0; -} -#else -extern "C" int my_thread_scheduler_set(scheduler_functions *scheduler) -{ return 1; } - -extern "C" int my_thread_scheduler_reset() -{ return 1; } -#endif - diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 059fc197d22..78e5b5b3833 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1516,8 +1516,8 @@ int plugin_init(int *argc, char **argv, int flags) } /* prepare debug_sync service */ - DBUG_ASSERT(strcmp(list_of_services[5].name, "debug_sync_service") == 0); - list_of_services[5].service= *(void**)&debug_sync_C_callback_ptr; + DBUG_ASSERT(strcmp(list_of_services[4].name, "debug_sync_service") == 0); + list_of_services[4].service= *(void**)&debug_sync_C_callback_ptr; mysql_mutex_lock(&LOCK_plugin); diff --git a/sql/sql_plugin_services.h b/sql/sql_plugin_services.h index e3ef338eaad..d2f60a6e08c 100644 --- a/sql/sql_plugin_services.h +++ b/sql/sql_plugin_services.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. + Copyright (c) 2012, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,11 +42,6 @@ static struct thd_wait_service_st thd_wait_handler= { thd_wait_end }; -static struct my_thread_scheduler_service my_thread_scheduler_handler= { - my_thread_scheduler_set, - my_thread_scheduler_reset, -}; - static struct progress_report_service_st progress_report_handler= { thd_progress_init, thd_progress_report, @@ -63,7 +59,6 @@ static struct st_service_ref list_of_services[]= { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler }, { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler }, { "thd_wait_service", VERSION_thd_wait, &thd_wait_handler }, - { "my_thread_scheduler_service", VERSION_my_thread_scheduler, &my_thread_scheduler_handler }, { "progress_report_service", VERSION_progress_report, &progress_report_handler }, { "debug_sync_service", VERSION_debug_sync, 0 }, // updated in plugin_init() { "thd_kill_statement_service", VERSION_kill_statement, &thd_kill_statement_handler } |