-
Notifications
You must be signed in to change notification settings - Fork 556
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
Engine abstraction remove legacy writer #10076
Engine abstraction remove legacy writer #10076
Conversation
It is not a pure refactoring: Previously the code checked whether the flush succeeded. The new code assumes that a later flush will succeed. This is a change and behavior beyond a simple refactoring. This commit also removes JobTimeoutTriggerTest. This test had just one testcase. Also adds method to ProcessingScheduleService to schedule a task with a delay.
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.
@pihme didn't expected a PR regarding this 😁 but this a significant step forward. Awesome thank you 🏆 🤗
I had some comments, please see below before merging :)
engine/src/main/java/io/camunda/zeebe/engine/api/TaskResult.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/api/TaskResultBuilder.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/api/ProcessingScheduleService.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/engine/api/ProcessingScheduleService.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/streamprocessor/DirectTaskResultBuilder.java
Show resolved
Hide resolved
engine/src/main/java/io/camunda/zeebe/streamprocessor/ProcessingScheduleServiceImpl.java
Show resolved
Hide resolved
bors merge |
10076: Engine abstraction remove legacy writer r=pihme a=pihme ## Description - Introduces a new task that can be scheduled by the engine and that can return records to be written - Replaces all references to `LegacyTypedStreamWriter`outside of stream processor with scheduling of the new tasks - The overall result is that the engine no longer depends on any writer that writes directly to the stream. Stream processor is now in full control of when and how records shall be written (Heureka!) ## Related issues related to #9724, #9730, #9725 Co-authored-by: pihme <pihme@users.noreply.github.com>
Build failed: |
bors retry |
10076: Engine abstraction remove legacy writer r=pihme a=pihme ## Description - Introduces a new task that can be scheduled by the engine and that can return records to be written - Replaces all references to `LegacyTypedStreamWriter`outside of stream processor with scheduling of the new tasks - The overall result is that the engine no longer depends on any writer that writes directly to the stream. Stream processor is now in full control of when and how records shall be written (Heureka!) ## Related issues related to #9724, #9730, #9725 Co-authored-by: pihme <pihme@users.noreply.github.com>
bors r- @pihme I need to take a look at the scheduling first I think there might be some issue with the processing and scheduling work in between |
Canceled. |
I will merge it after I have checked it :) |
We need to make sure that we are not concurrently executing the scheduled tasks and the processing otherwise we might corrupt the writers, and maybe not seeing all data which have been submitted in transactions.
The dispatcher might be full and will return a negative or zero position, we need to retry writing to the dispatcher otherwise we might lose the records.
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.
Hey @pihme
I added some more commits to your PR I hope that was OK. This allows us to make sure that the tasks are only scheduled between processing, furthermore, we retry the writing.
I added some new tests regarding the schedule service. Are you interested in reviewing the changes?
engine/src/main/java/io/camunda/zeebe/engine/processing/job/JobBackoffChecker.java
Show resolved
Hide resolved
...t/java/io/camunda/zeebe/engine/processing/streamprocessor/ProcessingScheduleServiceTest.java
Fixed
Show fixed
Hide fixed
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.
Looks good to me
/** | ||
* @return allows to determine whether there is a current processing is on going | ||
*/ | ||
public boolean isInProcessing() { |
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.
🔧 I think this could be package/default visibility; dito for setter
@Zelldon I cannot add myself as reviewer as I am the author. Nevertheless, I did the review and approve it. |
😁 thanks @pihme 🙇 |
The actor#run blocked the entire StreamProcessor actor, which caused major issues (in tests). We need to observe whether submit is good enough.
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.
bors r+
bors r- |
Canceled. |
bors r+ |
Build succeeded: |
Description
LegacyTypedStreamWriter
outside of stream processor with scheduling of the new tasksRelated issues
related to #9724, #9730, #9725
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.