-
Notifications
You must be signed in to change notification settings - Fork 576
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
Fix broken downtime comment sync #10000
base: master
Are you sure you want to change the base?
Conversation
Quick question: would this also fix the following issue: |
It would be very helpful to get an answer to this. |
Hi, we don't know for sure whether this will fix #10078 as we still haven't identified exactly what is going wrong there, other than something is not working as expected. It's unlikely that this PR will fix #10078, but we can't tell you for sure until the cause for #10078 is identified. |
@yhabteab When will this request be completed? Is there a timeline? |
e3c289f
to
78095b8
Compare
cb4fe57
to
eb97676
Compare
I believe similar problems will still exist for other types where there's no |
6effb4a
to
687013c
Compare
Another list of non-navigable dependencies :):
|
687013c
to
f8df6b4
Compare
While cross-checking1 the dependencies added by this PR, I both noticed another problem as well a different idea to fix this in a hopefully more reliable way. The problem: There are object types that allow referencing other types of the same type. The first example of this I found is icinga2/lib/icinga/hostgroup.ti Line 22 in 5e9e0bb
Something very similar also exists for icinga2/lib/icinga/timeperiod.ti Lines 27 to 32 in 5e9e0bb
So no matter how we reorder the types, the issue that the order of individual objects within a type can also make a difference, i.e. the included/excluded time periods have to be sent, otherwise the same problem can happen there as well (and then continue to affect other objects that reference these time periods like hosts and services). However, on a positive note, it looks like there's actually an easy solution to this: Icinga 2 already tracks these dependencies between individual config objects on a per-object basis (https://github.com/Icinga/icinga2/blob/master/lib/base/dependencygraph.hpp, https://github.com/Icinga/icinga2/blob/master/lib/base/dependencygraph.cpp). Thus, we should be able to solve both the problem that was the reason for starting this PR as well as the other one I just mentioned by sending the config objects in a topological sort order in respect to Footnotes
|
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.
For completeness, I already wrote the following inline comment before figuring out #10000 (comment). I'm submitting this for completeness so that it doesn't get forgotten as a pending comment, but there's a good chance it will become obsolete.
No, it won't! I actually did notice this, but didn't want to go into it too much since it's a relationship on a per object basis and not on the actual types themselves. Icinga 2 happily accepts such a config, and none of the proposed alternatives is going to overcome it. object HostGroup "foo" {
groups = [ "bar" ]
}
object HostGroup "bar" {
groups = [ "foo" ]
} {
"attrs": {
"__name": "bar",
"display_name": "bar",
"groups": [
"foo"
],
"name": "bar",
"type": "HostGroup",
},
"name": "bar",
"type": "HostGroup"
},
{
"attrs": {
"__name": "foo",
"display_name": "foo",
"groups": [
"bar"
],
"name": "foo",
"type": "HostGroup",
},
"name": "foo",
"type": "HostGroup"
} |
And this config! object TimePeriod "included" {
excludes = ["excluded"]
ranges = { "2024-10-14" = "14:00-15:00" }
}
object TimePeriod "excluded" {
excludes = ["included"]
ranges = { "2024-10-14" = "13:00-15:00" }
} There is absolutely nothing in the code that prevents two objects from becoming dependent on each other. |
Indeed, it would not make every (currently) possible situation work, but at least for all objects where it's possible.
With these objects, it's simply impossible to order them such that each object is synced before all of its dependencies. And such config being accepted looks like a bug to me. Note that this ordering is only relevant for runtime-created objects, so defining something like this in a config file wouldn't even be a problem here. However, you can also create the dependency cycle by modifying attributes at runtime (if allows, for nested host/service groups it isn't, the |
cc1263b
to
9d5a8b6
Compare
0435672
to
6f4d8c8
Compare
6f4d8c8
to
1d62919
Compare
1d62919
to
70ccb4c
Compare
All objects must be synced sorted by their load dependency. Otherwise, downtimes and/or comments might get synced before their respective Checkables, which will result in comments and downtimes being ignored by the other endpoint since it does not yet know about their checkables. Given that the runtime config updates event does not trigger a reload on the remote endpoint, these objects won't be synced again until the next reload.
After master2 reload:
closes #7786
closes #9873
TODO