HA: Reset stalled processing queue entries & use updatable last_update timestamp#466
Merged
Conversation
Instead of deleting event queue entries in a stalled processing state, reset them to the pending state. Initially, there was only one kind of retention, which deleted affected rows. With the last refactoring[0], the logic became easier to adjust. This enabled this change, introducing the ResetPruner, which performs a UPDATE query instead of a DELETE. As old event queue entries in the processing state imply a crashed daemon or another fatal error, they should be reset and retried. Otherwise, we would lose events, which we accept prior to this commit. As a drive by change, the queue state variables from the event package were exported. This allowed getting rid of magic numbers in the static dbPruner configuration. [0]: fb63975
18d6093 to
62b8763
Compare
Use a dedicated last_update timestamp instead of the event time for the event queue. While this timestamp is used where the prior time - now renamed to event_time - is used, it can be updated for each event queue object modification. This ensures that the retention uses the defined durations instead of the duration minus an unknown delta, depending on when the event was processed or how long it waited in the queue.
Member
Author
|
I have pushed a second commit, introducing a second update-able timestamp used for retention - as discussed yesterday. More details are in the commit message and in the updated top post. |
Member
Author
|
Just verified the schema upgrade: no diff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #394.