This isn't a general problem. Happens only few times per day.
However, I haven't found any documentation regarding the "
wsrep in pre-commit stage" status for queries and what could be causing it to take longer than normal.
Sometimes, my UPDATE/INSERT queries take around 3-20 seconds to complete.
I setup profiling to see what is actually happening and here is what it showed:
UPDATE users SET user_lastlogin=NOW() WHERE user_id='103396'Status | Duration |
starting | 0.000020 |
checking permissions | 0.000003 |
Opening tables | 0.000010 |
init | 0.000032 |
System lock | 0.000037 |
updating | 0.000189 |
end | 0.000003 |
Waiting for query cache lock | 0.000002 |
end | 0.000051 |
query end | 0.000007 |
wsrep in pre-commit stage | 10.479955 |
ha_commit_one_phase(287176997) | 0.000004 |
innobase_commit_low():trx_comm | 0.000016 |
ha_commit_one_phase(287176997) | 0.000052 |
wsrep in pre-commit stage | 0.000017 |
closing tables | 0.000011 |
freeing items | 0.000034 |
logging slow query | 0.000002 |
logging slow query | 0.000002 |
cleaning up | 0.000002 |
I would love to know what actually the "pre-commit" stage does and how it is tuned/monitored.
I have attached my "show status" and "show variables" in case someone can take a deeper look.
Once again, this isn't a general problem and happens only a few times per day.
Thank you!