Skip to content

IcingaDB: Make Redis & DB values consistent #10452

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

Merged
merged 8 commits into from
Jun 10, 2025

Conversation

yhabteab
Copy link
Member

@yhabteab yhabteab commented May 21, 2025

This tries to make some of the values written to Redis and to the Database more consistent. Specifically, previously Icinga DB sent 0 or 1 for the state_type field, and the Icinga DB (Go) daemon mapped them to soft and hard accordingly before writing them to the database. This is not the case anymore, and Icinga DB (C++) now writes soft and hard directly to Redis. This also applies to the comment#entry_type, {user, notification}#types,states and notification#type fields. They all are now serialized exactly how they're going to be written to the database, thus eliminating the need for the Go daemon to do any mappings. Apart from that, the is_acknowledged field is now serialized as true or false as opposed to 1 (normal) or 2 (sticky) previously. From now on that field will be set to true if the checkable has been acknowledged, and the new is_sticky_acknowledgement field will be set to true if the acknowledgement is sticky.

One additional bug that's been fixed by this PR but isn't related to the above topic is that the {user, notification}#types,states bitsets will correctly be refreshed whenever the user or notification types,states attributes are changed at runtime. Previously, the bitsets were only updated at startup, and never refreshed again (see 98dee18).

Required By

fixes #9427

@yhabteab yhabteab force-pushed the streamline-redis-and-db-values branch 2 times, most recently from 4ffd3e8 to 64fe23f Compare June 4, 2025 12:10
@yhabteab
Copy link
Member Author

yhabteab commented Jun 4, 2025

I think, I've addressed all the changes you requested, and the integration tests seems to be happy with this, so please have another look.

@yhabteab yhabteab requested a review from julianbrost June 4, 2025 12:19
@yhabteab yhabteab force-pushed the streamline-redis-and-db-values branch 2 times, most recently from c747b9d to 8c4b592 Compare June 5, 2025 08:18
@yhabteab yhabteab force-pushed the streamline-redis-and-db-values branch 3 times, most recently from a41036d to 695ad3f Compare June 5, 2025 08:34
yhabteab added 8 commits June 6, 2025 13:31
So that Icinga DB (Go) daemon doesn't have to make the mappings again.
…trs change

Since the types and states attributes are user configurable and allowed to change at
runtime, we need to update the actual filter bitsets whenever these attributes change.
Otherwise, the filter bitsets would be stale and not reflect their current state.
@yhabteab yhabteab force-pushed the streamline-redis-and-db-values branch from 695ad3f to 9e65a8b Compare June 6, 2025 11:31
@julianbrost julianbrost merged commit c41fe68 into master Jun 10, 2025
25 checks passed
@julianbrost julianbrost deleted the streamline-redis-and-db-values branch June 10, 2025 09:30
nilmerg added a commit to Icinga/icingadb-web that referenced this pull request Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icinga DB state_type and is_acknowledged keys in redis don't match with what's inserted into the DB
2 participants