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
Apply event-sourcing to the process instance subscription correlate processor #6558
Conversation
eb36b18
to
e6354dd
Compare
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 there is one mistake in it.
And I have a question and a comment.
@@ -25,52 +25,66 @@ | |||
private final KeyGenerator keyGenerator; | |||
private final MutableEventScopeInstanceState eventScopeInstanceState; | |||
|
|||
// TODO (saig0): use immutable states only (#6200) |
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.
FYI when working on Job.ThrowError I opted not to use this class again, I split it up into the parts that modify state and parts that don't and had to refactor the logic so much, that it didn't resemble well the existing class. Especially, because Job.ThrowError is using error event handle, so there was more logic to look at.
Same is currently true for the work on timer processors. We pretty much inlined the methods of this class into the timer processor and then migrated the inlined version.
This may be questionable in terms of DRY, but has some benefits in terms of reducing dependencies.
There is stuff in JobThrowErrorProcessor
which could be harvested as part of #6200. And I guess we could make a deliberate decision whether we want to keep this class. If so, we need some refactoring in JobThrowError processor to use the migrated class again.
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 it is okay to use this class for now because it doesn't modify the state here effectively. In the end, I would like to avoid duplication. But let's do it as part of #6200.
...n/java/io/zeebe/engine/processing/message/ProcessInstanceSubscriptionCorrelateProcessor.java
Outdated
Show resolved
Hide resolved
public void applyState(final long key, final ProcessInstanceSubscriptionRecord value) { | ||
|
||
if (value.isInterrupting()) { | ||
subscriptionState.remove(value.getElementInstanceKey(), value.getMessageNameBuffer()); |
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.
Question for my understanding: How do the other partitions know that the subscription was removed?
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.
The message subscription of the other partition has the same property. The processor closes the message subscription when sending the correlate
command.
@pihme thanks 🍰 I applied your suggestion. Please have a look. |
* align the processor's name with the intent * move the state changes in the new event applier * extract the bootstrapping of the pending subscription checker * cancel/pause the subscription checker if the processing is paused or failed
b92eae0
to
e77bc10
Compare
bors r+ |
Build succeeded: |
6811: Improve time handling in random processes r=pihme a=pihme ## Description - adds information to AbstractExecutionStep whether the step is automatic or can be controlled in execution - adds information to AbstractExecutionStep how much execution time the step will consume - adds new class ScheduledExecutionStep to decorate an execution step with time and scheduling information - changes the way that variables are computed; they can now be overridden after the full execution path is known. In particular, this is done to set the timeouts of boundary timer events based on their effective activation time. For a description of the concept, look at #6558 - adds boundary timer events to Service Task and Sub Process as a proof of concept - adds some quality of life improvements like printing out at which point in the execution a failure occurred Recommended way to review this: - read about concept in #6568 - scan over the history of commits (not so much to review each commit, but more to get a sense of the overall zig zag) - check out branch and review end product ## Related issues closes #6568 Co-authored-by: pihme <pihme@users.noreply.github.com>
Description
CorrelateProcessInstanceSubscription
toProcessInstanceSubscriptionCorrelateProcessor
Related issues
closes #6182
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/0.25
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation: