← Back to team overview

maria-discuss team mailing list archive

Re: Thread State: Unlocking tables


Hi, mariadb!

On Sep 03, mariadb@xxxxxxxxxxxxxx wrote:
> Can someone fill me in as to what's happening behind the scenes when a 
> thread has the state "Unlocking tables?"

It literally does just that, unlock tables.
There's nothing that could cause a long wait, as far as I can see.

> I looked here but did not see it listed:
> https://mariadb.com/kb/en/library/general-thread-states/
> Specifically, I sometimes see threads spending a lot of time in this 
> state, and am looking to do some troubleshooting as to the cause of the 
> delay. I.E., what could cause a thread to be delayed while in that state.

What statement spends a lot of time in this state?
May be the table unlocking was long done, but some rogue code didn't
reset the state.

What other threads are doing at this time? "Unlocking tables" should be
fast, but still there are some mutex locks there, so if another thread
got stuck holding that mutex (I don't see how, but still), it might've
blocked unlocking.

> They're (currently) MyISAM tables if it makes a difference.

It does. With InnoDB it's a bit more complicated.

VP of MariaDB Server Engineering
and security@xxxxxxxxxxx

Follow ups