[ZBX-17311] Button "clean history and trends" locked database Created: 2020 Feb 12 Updated: 2021 May 20 Resolved: 2020 Jul 02 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 4.4.4 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | Mykola Kuzmych | Assignee: | Kristians Pavars |
Resolution: | Cannot Reproduce | Votes: | 0 |
Labels: | pending | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Linux 3.10.0-1062.4.3.el7.x86_64 #1 SMP Wed Nov 13 23:58:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
Attachments: |
![]() ![]() ![]() ![]() |
||||
Issue Links: |
|
Description |
Steps to reproduce:
My configuration: All other function work fine at this time. |
Comments |
Comment by Aigars Kadikis [ 2020 Feb 13 ] |
Thank you for using the latest stable version. Can you explain why you manually run 'DELETE from ..' ? Usually, it's a task for a housekeeper to clean the old data a little later according to the settings mentioned:
grep "HousekeepingFrequency=\|MaxHousekeeperDelete=" /etc/zabbix/zabbix_server.conf
I warmly suggest to take a look on Monitoring -> Graphs -> Host group: Zabbix server -> Host: Zabbix server. There are 5 graphs (starts with name "Zabbix ..") which indicates the internal health of the core server.
|
Comment by Mykola Kuzmych [ 2020 Feb 13 ] |
Result for my houskeeping - default $ grep "HousekeepingFrequency=|MaxHousekeeperDelete=" /usr/local/etc/zabbix_server.conf
The health for my zabbix is fine for all processes and queues. I dont run mannualy this query. I have problem with button "clean history and trends" - it call query immediately from site. For example I want clear history by button for 3 elements, ids: 35187,35188,52548. When I click button from front zabbix - start query: DELETE FROM history_uint WHERE itemid IN (35187,35188,52548) This query locked all query by zabbix_server (from zabbix server_log): 17220:20200213:140645.789 [Z3005] query failed: [1205] Lock wait timeout exceeded; try restarting transaction [insert into history_log (itemid,clock,ns,timestamp,source,severity,value,logeventid) values$ Table history_uint has no key for itemid: history_uint | CREATE TABLE `history_uint` ( This query for me - around 7 minutes. So now I must hide this button from other administrators - because system crashed on click. I attach some screen. Thanks! |
Comment by Mykola Kuzmych [ 2020 Feb 19 ] |
I have already added info for problem |
Comment by Aigars Kadikis [ 2020 Feb 26 ] |
Hello, This can be a problem while using MyISAM type instead of InnoDB. I see you already mentioned you got InnoDB in the description. Please also ensure it's active at table level. show create table history_uint\G It should show: CREATE TABLE `history_uint` ( |
Comment by Mykola Kuzmych [ 2020 Feb 26 ] |
Hello! Yes, I'm use InnoDB. mysql Ver 8.0.17 for Linux on x86_64 (Source distribution) Table: history_uint Create Table: CREATE TABLE `history_uint` ( `itemid` bigint(20) unsigned NOT NULL, `clock` int(11) NOT NULL DEFAULT '0', `value` bigint(20) unsigned NOT NULL DEFAULT '0', `ns` int(11) NOT NULL DEFAULT '0', KEY `history_uint_1` (`itemid`,`clock`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 1 row in set (0.00 sec) |
Comment by Kristians Pavars [ 2020 Jun 18 ] |
Hi pixart
Sorry for the long delay. This seems like a performance issue with MySQL database, have you done any performance tuning to it? The button is supposed to clear all entries when clicked and if there is a lot of data to clear then it will take longer to delete it all.
Regards, |