-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gnocchi database is not deleting old revisions #1182
Comments
I don't think there is any such logic yet, that could probably be implemented into the chef part [1] [1] https://github.com/gnocchixyz/gnocchi/blob/master/gnocchi/chef.py |
I tested this in a Gnocchi 4.3.6 setup and I could not reproduce it. I deleted the resource using the Gnocchi API ( Can you reproduce the issue or did I misinterpret something? |
Hi @tobias-urdin you understood my problem. |
Can you please post output of command with |
@tobias-urdin here is output with debug. This command returns empty body, assuming there aren't resources older than 50 days. |
So deleting a resource should mark it's metrics as status=delete and the gnocchi-metricd daemon should purge those metrics after a while (depending on your load). Resource history entries is tied to the resource_id field on metrics in the database.
|
Hi @tobias-urdin I'm not familiar with mysql binary, hope i 'we looked for data right way (cli ran with --binary-as-hex param) table resource history creator: 62108b4d78be4025ae91ccad3c6d3706:a13caacbe5904dd8a2f730bae1950451 table metric MariaDB [gnocchi]> select HEX(id) from metric where id='0xD14FBCA6E5A24906B4D9AA1C9A84673D'; |
Try with |
@tobias-urdin seems there is no metric. /home/ubuntu# mysql --binary-as-hex MariaDB [gnocchi]> select * from metric where resource_id = '0xD14FBCA6E5A24906B4D9AA1C9A84673D'; |
So yeah like I thought in #1182 (comment) this is currently a flaw in Gnocchi. We need to introduce either 1) logic that purges orphaned resource history entries post delete or 2) in I don't currently have time to look into this right now but perhaps can in the near future. [1] https://github.com/gnocchixyz/gnocchi/blob/master/gnocchi/rest/api.py#L1111 |
I can confirm this is also happening in 4.4.1 on a Xena Openstack deployment with resource_history and rt_[...]_history (instance resource type for nova) tables growing significantly. Currently they add up to 13GB where as in 4.3.4 on a deployment with Train this behavior is not present. resource_history holds mostly duplicated data with only revision and revision timestamps changing across entries. |
This bug is about resource history not being properly deleted in indexer when a resource is deleted. I've seen the same behaviour that you are describing when having a resource with metadata/attributes that is changing a lot when polled causing increase of resource history per iteration, in our case that was caused by a bug/issue that kept changing the display_name field. Can you correlate any specific differences between resource histories on a resource? From our internal commit msg:
|
Adding some more feedback as we have also observed this. It might not be tied to a gnocchi version necessarily, as we have this problem in gnocchi 4.4.1 but not (or at least not to the same extent) in v4.3.4. The initial report mentions having this with gnocchi 4.3.3. |
Before reporting an issue on Gnocchi, please be sure to provide all necessary
information.
Which version of Gnocchi are you using
Gnocchi 4.3.3
How to correctly clean up old and not deleted revisions?
I found out revisions which belongs to deleted resources. As a consequence is that mysql table resource_history is growing constantly.
Thanks.
The text was updated successfully, but these errors were encountered: