Repository navigation
Add in-memory causal ordering for task run recorder - #18634
Merged
Merged
Conversation
CodSpeed Performance ReportMerging #18634 will not alter performanceComparing Summary
|
zzstoatzz
approved these changes
Aug 4, 2025
zzstoatzz
left a comment
Collaborator
There was a problem hiding this comment.
awesome! just a couple nits
rekumar
pushed a commit
to rekumar/prefect
that referenced
this pull request
Sep 12, 2025
2 of 3 tasks
br413
pushed a commit
to br413/prefect
that referenced
this pull request
Jul 14, 2026
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.
Causal event ordering was removed from the task run recorder in #15244, which I firmly believe has led to the errors seen in #17767. Task run events may arrive out of order. While it's rare, with enough volume, out-of-order task run events become common and can lead to failed inserts and tasks appearing to stay in running if the
COMPLETEDraces the initial event for a task and loses.The original causal ordering implementation used the database for storage, which led to poor DB performance. This PR introduces an in-memory implementation of causal ordering to avoid DB performance degradation while getting the benefits of causal ordering for single-server setups.
For multi-server setups, a causal ordering implementation already exists in
prefect-redis. We can add a mechanism to swap out the causal ordering implementation in a subsequent PR.Closes #17767