Thread pool breaks -DWITHOUT_PERFSCHEMA_ENGINE=1

Bug #1201263 reported by Laurynas Biveinis on 2013-07-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Triaged
High
Unassigned
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Triaged
High
Unassigned

Bug Description

=== modified file 'Percona-Server/sql/threadpool_common.cc'
--- Percona-Server/sql/threadpool_common.cc 2013-05-27 03:01:29 +0000
+++ Percona-Server/sql/threadpool_common.cc 2013-07-05 04:55:55 +0000
@@ -71,19 +71,25 @@
 */
 struct Worker_thread_context
 {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   PSI_thread *psi_thread;
+#endif
   st_my_thread_var* mysys_var;

   void save()
   {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
     psi_thread= PSI_server?PSI_server->get_thread():0;
+#endif
     mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);
   }

   void restore()
   {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
     if (PSI_server)
       PSI_server->set_thread(psi_thread);
+#endif
     pthread_setspecific(THR_KEY_mysys,mysys_var);
     pthread_setspecific(THR_THD, 0);
     pthread_setspecific(THR_MALLOC, 0);
@@ -99,8 +105,10 @@
   pthread_setspecific(THR_KEY_mysys,thd->mysys_var);
   thd->thread_stack=(char*)&thd;
   thd->store_globals();
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   if (PSI_server)
     PSI_server->set_thread(thd->event_scheduler.m_psi);
+#endif
   mysql_socket_set_thread_owner(thd->net.vio->mysql_socket);
   return 0;
 }
@@ -195,13 +203,14 @@
     return 1;
   }

+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   /* Create new PSI thread for use with the THD. */
   if (PSI_server)
   {
     thd->event_scheduler.m_psi=
       PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);
   }
-
+#endif

   /* Login. */
   thread_attach(thd);

=== modified file 'Percona-Server/sql/threadpool_unix.cc'
--- Percona-Server/sql/threadpool_unix.cc 2013-05-27 03:01:29 +0000
+++ Percona-Server/sql/threadpool_unix.cc 2013-07-05 04:57:16 +0000
@@ -53,7 +53,7 @@
   and timer thread with its own mutex and condition.
 */

-
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
 static PSI_mutex_key key_group_mutex;
 static PSI_mutex_key key_timer_mutex;
 static PSI_mutex_info mutex_list[]=
@@ -81,7 +81,7 @@
 /* Macro to simplify performance schema registration */
 #define PSI_register(X) \
  if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
-
+#endif

 struct thread_group_t;

@@ -1554,9 +1554,11 @@
     sql_print_error("Can't set threadpool size to %d",threadpool_size);
     DBUG_RETURN(1);
   }
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   PSI_register(mutex);
   PSI_register(cond);
   PSI_register(thread);
+#endif

   pool_timer.tick_interval= threadpool_stall_limit;
   start_timer(&pool_timer);

summary: - Thread pool breaks -DWITHOUT_PERFSCHEMA_ENGINE=
+ Thread pool breaks -DWITHOUT_PERFSCHEMA_ENGINE=1
tags: added: low-hanging-fruit
tags: added: tp
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers