Skip to content
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

IcingaDB: Sync downtime cancel_time conditionally #10379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yhabteab
Copy link
Member

fixes #9612

After

docker exec -i redis redis-cli -p 6380 --raw XREAD streams icinga:history:stream:downtime 0

Downtime{Started,Ended}:

icinga:history:stream:downtime
1741949150582-0
downtime_id
23acf3150240e0d8bbffadc1081bf433825f0763
environment_id
f4df75fa7f252696a4e21b1144feac7ebaa87d3c
host_id
a7b8326f4554643d22e8b170cc3a28392d355390
entry_time
1741949150360
author
icingaadmin
comment
IPv4 network maintenance
is_flexible
0
flexible_duration
0
scheduled_start_time
1741949150000
scheduled_end_time
1741949210000
has_been_cancelled
0
trigger_time
1741949150360
event_id
96da3797a5d99341b0cae5893b1258dda0a54a92
event_type
downtime_start
object_type
service
service_id
eac9c2dd2a67b59544e9e3ae8eeb86a4c405d566
start_time
1741949150000
end_time
1741949210000
endpoint_id
3d42be5dfd885d4e763379f6cdbbb26faf9bd2b0
1741949210340-0
downtime_id
23acf3150240e0d8bbffadc1081bf433825f0763
environment_id
f4df75fa7f252696a4e21b1144feac7ebaa87d3c
host_id
a7b8326f4554643d22e8b170cc3a28392d355390
entry_time
1741949150360
author
icingaadmin
cancelled_by

comment
IPv4 network maintenance
is_flexible
0
flexible_duration
0
scheduled_start_time
1741949150000
scheduled_end_time
1741949210000
has_been_cancelled
0
trigger_time
1741949150360
event_id
2a65d064a104a30b96b8c3fd34aa5e170ebaf48a
event_type
downtime_end
object_type
service
service_id
eac9c2dd2a67b59544e9e3ae8eeb86a4c405d566
start_time
1741949150000
end_time
1741949210000
endpoint_id
3d42be5dfd885d4e763379f6cdbbb26faf9bd2b0

DowntimeRemoved: /v1/actions/remove-downtime

comment
IPv4 network maintenance
is_flexible
0
flexible_duration
0
scheduled_start_time
1741949668000
scheduled_end_time
1741949968000
has_been_cancelled
1
trigger_time
1741949668024
event_id
7d069fb1c24e7478860cec668eda31f312a19aec
event_type
downtime_end
cancel_time
1741949675638
object_type
service
service_id
eac9c2dd2a67b59544e9e3ae8eeb86a4c405d566
start_time
1741949668000
end_time
1741949968000
endpoint_id
3d42be5dfd885d4e763379f6cdbbb26faf9bd2b0

It's a downtime start event there's now way the downtime could be
cancelled before it even started.
If the downtime ended automatically `cancel_time` should just be `NULL`
instead of a `0` timestamp.
@yhabteab yhabteab added bug Something isn't working area/icingadb New backend labels Mar 14, 2025
@yhabteab yhabteab added this to the 2.15.0 milestone Mar 14, 2025
@yhabteab yhabteab requested a review from Al2Klimov March 14, 2025 10:58
@cla-bot cla-bot bot added the cla/signed label Mar 14, 2025
Copy link
Member

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but tests miss Icinga DB and Web IMAO.

@yhabteab
Copy link
Member Author

but tests miss Icinga DB and Web IMAO.

What do you want me to test? That column is nullable, so nothing changes for Icinga DB and Web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/icingadb New backend bug Something isn't working cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icinga DB: cancel_time in downtime history should not be 0
2 participants