-
Notifications
You must be signed in to change notification settings - Fork 584
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
Ido*sqlConnection#InternalDeactivateObject(): mark object inactive also in memory #8626
Conversation
…so in memory Previously: 1. You delete an object from a config file 2. You reload Icinga 3. Icinga fetches all objects and whether they're active from the IDO 4. Icinga recognizes that the just deleted object doesn't exist anymore 5. Icinga marks it as inactive in the IDO, but not in memory 6. You re-create the just deleted object via API 7. Icinga still thinks it's active and doesn't activate it - it's invisible refs #8584
63fa8ce
to
e0c1340
Compare
I've found how to reliably trigger this issue using only using the API (tested against 2.12.3). The key is that the host has to exist in the database when Icinga starts (or to be more precise: when Icinga (re)connects to the database).
Other insights when investigating this: This only results in a problem when activating objects, as there it is checked whether the object is considered to be active, while when deactivating an objects, this is already ignored: icinga2/lib/db_ido/dbconnection.cpp Lines 447 to 475 in aa4f530
So this PR fixes the issue but I think it can still be improved, either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #8626 (comment)
I'd leave this (change to an old-gen backend) as simple as possible as long as actually fixes the issue and doesn’t break anything. |
Would adding (Upon closer consideration, option 2 would probably need a bit more evaluation whether running a noop update query on each object on startup would hurt performance too much.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current state was deemed good enough for IDO.
Previously:
1. You delete an object from a config file
2. You reload Icinga
3. Icinga fetches all objects and whether they're active from the IDO
4. Icinga recognizes that the just deleted object doesn't exist anymore
5. Icinga marks it as inactive in the IDO, but not in memory
6. You re-create the just deleted object via API
7. Icinga still thinks it's active and doesn't activate it - it's invisible
fixes #8584