# Checking Permissions thread state

**URL:** <https://forums.percona.com/t/checking-permissions-thread-state/1638>\
**Category:** Other MySQL® Questions\
**Created:** [August 5, 2011, 3:33am UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638 "2011-08-05T03:33:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcel](https://forums.percona.com/u/marcel)\
**Post date:** [August 5, 2011, 3:33am UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638/1 "2011-08-05T03:33:45Z")

</div>

Since upgrading from mysql 5.0.41 to Percona 5.1.57-rel12.8-log we are experiencing queries which are stuck in thread state “Checking Permissions”.

the issue is most obvious when running stored procedures and is not constant. After a mysql restart the issue will disappear, and will return after a few days.

Have not found any good hints on the internet on how to debug this.

any hints?

thanks

marcel

---

<div class="post-metadata">

**Author:** ![sterin](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sterin](https://forums.percona.com/u/sterin)\
**Post date:** [August 5, 2011, 6:35am UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638/2 "2011-08-05T06:35:47Z")

</div>

Did you run the mysql\_upgrade command properly so that the privilege tables was updated?

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [August 5, 2011, 7:47am UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638/3 "2011-08-05T07:47:27Z")

</div>

It is also possible that there is a bug in the version of MySQL you’re running. (Unlikely that it’s a bug in Percona’s modifications; we don’t change anything to do with privileges, although it’s possible that the bug is elsewhere and just manifests here.)

Next time it hangs, get stack traces with [poormansprofiler.org](http://poormansprofiler.org) and paste them here. Also, it depends on whether it’s idle when hung, or burning CPU time. If it’s burning CPU (not really hung, but just doing a lot of useless work), then run oprofile for 30 seconds and paste the opreport.

---

<div class="post-metadata">

**Author:** ![marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcel](https://forums.percona.com/u/marcel)\
**Post date:** [August 6, 2011, 12:29pm UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638/4 "2011-08-06T12:29:20Z")

</div>

mysql\_upgrade was not relevant, as we upgraded using an imported dump, so not direct binary data.

Will try to run [poormansprofiler.org](http://poormansprofiler.org) next time

thanks

marcel

---

<div class="post-metadata">

**Author:** ![marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@marcel](https://forums.percona.com/u/marcel)\
**Post date:** [December 16, 2011, 1:16pm UTC](https://forums.percona.com/t/checking-permissions-thread-state/1638/5 "2011-12-16T13:16:04Z")

</div>

We caught the problem red handed today, here the poormansprofiler output

hope it helps. mysql\_upgrade didn’t give any relieve. reloading myql, adding more memory/moving tmp to ramdisk did not help.

Marcel

root@mysql1:~# ./poormansprofile.sh  
108  
49  
pthread\_cond\_wait&#64;&#64;GLIBC\_2.3.2 ,cache\_thread,optimized,handle\_one\_connection,start\_thread,c lone,??  
36  
_lll\_lock\_wait,L\_lock\_1172,pthread\_mutex\_lock,fill\_schema user\_privileges,get\_schema\_tables\_result,JOIN::exec,subselec t\_single\_select\_engine::exec,Item\_subselect::exec,Item\_in\_su bselect::val\_bool,Item\_in\_optimizer::val\_int,Item::val\_bool, Item\_func\_not::val\_int,Item::val\_bool,Item\_cond\_and::val\_int ,evaluate\_join\_record,sub\_select,do\_select,JOIN::exec,subsel ect\_single\_select\_engine::exec,Item\_subselect::exec,Item\_in subselect::val\_bool,Item\_in\_optimizer::val\_int,Item::val\_boo l,Item\_cond\_and::val\_int,evaluate\_join\_record,sub\_select,do_ select,JOIN::exec,mysql\_select,handle\_select,execute\_sqlcom\_ select,mysql\_execute\_command,mysql\_open\_cursor,sp\_cursor::op en,sp\_instr\_copen::exec\_core,sp\_lex\_keeper::reset\_lex\_and\_ex ec\_core,sp\_instr\_copen::execute,sp\_head::execute,sp\_head::ex ecute\_procedure,mysql\_execute\_command,sp\_instr\_stmt::exec\_co re,sp\_lex\_keeper::reset\_lex\_and\_exec\_core,sp\_instr\_stmt::exe cute,sp\_head::execute,sp\_head::execute\_procedure,Event\_job\_d ata::execute,Event\_worker\_thread::run,event\_worker\_thread,st art\_thread,clone,??  
10  
pthread\_cond\_wait&#64;&#64;GLIBC\_2.3.2 ,os\_event\_wait\_low,os\_aio\_simulated\_handle,fil\_aio\_wait,io\_h andler\_thread,start\_thread,clone,??  
1 sigwait,signal\_hand,start\_thread,clone,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2,os\_event\_wait\_time,srv\_purge\_thread,start\_thread,clone,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2 ,os\_event\_wait\_time,srv\_monitor\_thread,start\_thread,clone,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2,os\_event\_wait\_time,srv\_master\_thread,start\_thread,clone,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2 ,os\_event\_wait\_time,srv\_LRU\_dump\_restore\_thread,start\_thread ,clone,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2 ,os\_event\_wait\_time,srv\_lock\_timeout\_thread,start\_thread,clo ne,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2 ,os\_event\_wait\_time,srv\_error\_monitor\_thread,start\_thread,cl one,??  
1  
pthread\_cond\_timedwait&#64;&#64;GLIBC\_2.3.2 ,Event\_queue::cond\_wait,Event\_queue::get\_top\_for\_execution\_i f\_time,Event\_scheduler::run,event\_scheduler\_thread,start\_thr ead,clone,??  
1 poll,handle\_connections\_sockets,main  
1  
memcpy,heap\_scan,ha\_heap::rnd\_next,rr\_sequential,sub\_select, do\_select,JOIN::exec,subselect\_single\_select\_engine::exec,It em\_subselect::exec,Item\_in\_subselect::val\_bool,Item\_in\_optim izer::val\_int,Item::val\_bool,Item\_func\_not::val\_int,Item::va l\_bool,Item\_cond\_and::val\_int,evaluate\_join\_record,sub\_selec t,do\_select,JOIN::exec,subselect\_single\_select\_engine::exec, Item\_subselect::exec,Item\_in\_subselect::val\_bool,Item\_in\_opt imizer::val\_int,Item::val\_bool,Item\_cond\_and::val\_int,evalua te\_join\_record,sub\_select,do\_select,JOIN::exec,mysql\_select, handle\_select,execute\_sqlcom\_select,mysql\_execute\_command,my sql\_open\_cursor,sp\_cursor::open,sp\_instr\_copen::exec\_core,sp _lex\_keeper::reset\_lex\_and\_exec\_core,sp\_instr\_copen::execute ,sp\_head::execute,sp\_head::execute\_procedure,mysql\_execute\_c ommand,sp\_instr\_stmt::exec\_core,sp\_lex\_keeper::reset\_lex\_and exec\_core,sp\_instr\_stmt::execute,sp\_head::execute,sp\_head:: execute\_procedure,Event\_job\_data::execute,Event\_worker\_threa d::run,event\_worker\_thread,start\_thread,clone,??  
1  
block=0x7f046bbf3a58,block=0x7f046bbf3a58,block=0x7f046bbf 3a58,btr\_search\_guess\_on\_hash,btr\_cur\_search\_to\_nth\_level,b tr\_pcur\_open\_with\_no\_init\_func,optimized,optimized,ha\_innoba se::general\_fetch,join\_read\_next\_same,sub\_select,evaluate\_jo in\_record,sub\_select,evaluate\_join\_record,sub\_select,do\_sele ct,JOIN::exec,mysql\_select,handle\_select,execute\_sqlcom\_sele ct,mysql\_execute\_command,mysql\_parse,dispatch\_command,do\_com mand,handle\_one\_connection,start\_thread,clone,??  
1  
at,Item\_in\_optimizer::val\_int,Item::val\_bool,Item\_func\_not:: val\_int,Item::val\_bool,Item\_cond\_and::val\_int,evaluate\_join record,sub\_select,do\_select,JOIN::exec,subselect\_single\_sele ct\_engine::exec,Item\_subselect::exec,Item\_in\_subselect::val_ bool,Item\_in\_optimizer::val\_int,Item::val\_bool,Item\_cond\_and ::val\_int,evaluate\_join\_record,sub\_select,do\_select,JOIN::ex ec,mysql\_select,handle\_select,execute\_sqlcom\_select,mysql\_ex ecute\_command,mysql\_open\_cursor,sp\_cursor::open,sp\_instr\_cop en::exec\_core,sp\_lex\_keeper::reset\_lex\_and\_exec\_core,sp\_inst r\_copen::execute,sp\_head::execute,sp\_head::execute\_procedure ,mysql\_execute\_command,sp\_instr\_stmt::exec\_core,sp\_lex\_keepe r::reset\_lex\_and\_exec\_core,sp\_instr\_stmt::execute,sp\_head::e xecute,sp\_head::execute\_procedure,Event\_job\_data::execute,Ev ent\_worker\_thread::run,event\_worker\_thread,start\_thread,clon e,??
