history: Use initial timestamp for history retention#1066
Conversation
328a2ab to
b542c3e
Compare
This will always be done? So in case I have configured the history retention to be 30 days, and have a downtime, say created 42 days in the past. There would then be no indication of that downtime in the history (fine, it's older than 30 days), but if it now expires or gets cancelled, the downtime end history would be written but immediately deleted because it's start is older than 30 days? So after the next history retention run, there would be no sign in the history that a downtime ended like an hour ago? That sounds like it could result in misleading history: notifications missing, that would be explained by a later downtime end event. Hence, would it be possible to use something like
I think it would be a good idea to add a comment there that the difference is intentional and why it's done. Otherwise, that could be mistaken for an oversight in the future and be "fixed". |
|
Thanks for your ideas on this PR. Honestly, I am not even sure if I am in favor of the changes I have suggested here. This PR tries to address those forgotten entries which #913 cannot clean up anymore. My motivation was the Community Forum post with some 24k outdated comments which should have been deleted.
This should work, at least for downtimes. Unfortunately, both acknowledgements and comments do not necessarily need to have a expiry or remove date. Thus, you can still end up with some object being still acknowledged while the history does not say why anymore.
Good point. |
The history retention is currently based on the final or closing timestamp, if such a timestamp exists. This change also takes the initial timestamp into account as a fallback. As reported in the Community Forum[^0] and in an ongoing PR[^1], there might be (historical) history entries without a closing timestamp. Thus, these entries will never be rotated. Furthermore, based on the documentation, it might be expected that the initial timestamp is used for retention, not a later one. This change does not cover the SLA retention, to ensure no misleading SLA reports are being generated when a dangerously short SLA retention period was defined. [^0]: https://community.icinga.com/t/comment-history-and-retention-on-a-busy-system/15318/3 [^1]: #913
b542c3e to
d133ab4
Compare
That doesn't sound like a problem though. If the acknowledgement is still active, there's still the corresponding comment object that will show since when it was acknowledged. If that was years ago, I don't think there's anything wrong with no corresponding event showing in the history if the retention period is less than that. |
The history retention is currently based on the final or closing timestamp, if such a timestamp exists. This change also takes the initial timestamp into account as a fallback.
As reported in the Community Forum1 and in an ongoing PR2, there might be (historical) history entries without a closing timestamp. Thus, these entries will never be rotated. Furthermore, based on the documentation, it might be expected that the initial timestamp is used for retention, not a later one.
This change does not cover the SLA retention, to ensure no misleading SLA reports are being generated when a dangerously short SLA retention period was defined.
Footnotes
https://community.icinga.com/t/comment-history-and-retention-on-a-busy-system/15318/3 ↩
https://github.com/Icinga/icingadb/pull/913 ↩