by rockgeneral » Tue Feb 06, 2018 1:04 pm
Yesterday evening my agents were complaining that they couldn't make outbound calls. I ran "show full processlist;" and found that the vicidial_lists table was locked. There was a statement, OPTIMIZE table vicidial_lists which was also "Waiting for table metadata lock". When I killed this statement the lock on the table was released, all of the queued statements processed and the system began acting normally. To test I ran an OPTIMIZE table vicidial_lists statement from the command line and it too was "Waiting for table metadata lock" and needed to be killed. I hadn't rebooted in forever, so that evening I rebooted and then was able to execute the optimize on vicidial_lists and it completed as expected.
I ran a mysqlcheck medium check on the table and it came back normal, so I figured it just needed a reboot. Well, it is happening again today. Upon checking the various log files around the time it locked up, I found the script that is running the OPTIMIZE table vicidial_lists command. (AST_flush_DBqueue.pl) So every hour at the 11th minute this script runs, the vicidial_lists table gets locked and then I have to kill the command. The table only has 120 records in it. The optimize command should complete in milliseconds.
Does anyone have any ideas as to why the optimize table command would be hanging / locking?
Also, is it safe to rem the command out of the AST_flush_DBqueue.pl script for the time being while I sort this out?
System Info:
ViciBox_v9.x86_64-9.0.2.iso | Version: 2.14b0.5 SVN: 3551 | DB Schema Version: 1650 | Asterisk 13.29.2-vici | Single Server