[ZBX-9356] Alter Server behaviour when an history/trend insert query fails Created: 2015 Mar 02  Updated: 2017 May 30  Resolved: 2015 Mar 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.4.3
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Filipe Paternot Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: partitioning
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mysql 5.5 redhat 6.5



 Description   

When breaking your mysql historical partitions, you cannot add a given sets of data to your mysql database.

[Z3005] query failed: [1526] Table has no partition for value 1425297600 [insert into trends_uint (itemid,clock,num,value_min,value_avg,value_max) values (1907943,1425297600,1,124427,124427,124427),
...

Ok, that's natural to break your data if you cannot add to your database. And i already monitor zabbix_server.log for errors like this.

But your data gets flushed out and cache is not used to store it.
Zabbix Server knows that it did not insert successfully to the database, so it should hold that data in History Cache until it can safely store it. This behavior would then fit perfectly with the description of History Cache (text and uint) usage:

"History cache stores item and timestamp information for all item types as well as value for the numeric types. A low number indicates performance problems on the database side."
From https://www.zabbix.com/documentation/2.4/manual/config/items/itemtypes/internal



 Comments   
Comment by Aleksandrs Saveljevs [ 2015 Mar 03 ]

Officially, Zabbix does not support partitions, so this issue is unlikely to be considered just because of that.

However, there is also another problem. Suppose Zabbix would keep historical data in the history cache that it cannot insert into the database. But the history cache is not infinite - it also has a limited size. Therefore, at some point, history cache will become full and the whole Zabbix server would block, waiting for the history cache to be freed. This would not be good either.

So it is proposed that this issue is closed as "Won't fix".

Comment by Alexander Vladishev [ 2015 Mar 04 ]

I close the issue as "Won't Fix".

Comment by Filipe Paternot [ 2015 Mar 05 ]

When i opened the ticket i had in mind not table partition specifically: this was just my recent experience. I meant to be alerted whenever a insert query fails because that data is trashed away and there is no default control for that, only the experience to setup the right items and triggers.

Maybe we could at least add it to best practices or default template of zabbix server an item/trigger to monitor the log for common "invisible" errors?

Comment by Marc [ 2015 Mar 06 ]

The request seems legitimate to me.
What is the difference (related to history cache) between a not available database or a failed transaction?

Comment by Aleksandrs Saveljevs [ 2015 Mar 06 ]

If the database is not available, Zabbix will wait until it is available by periodically trying to reconnect, because database connection failure is known to be a temporary situation. A failed transaction, on the other hand, is something extraordinary, something that should never happen and for this reason is very likely to be non-recoverable in the general case. This is why recovery is not attempted.

Generated at Fri Apr 04 22:17:39 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.