-
Notifications
You must be signed in to change notification settings - Fork 638
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
[EPIC] Generalized command distribution #11456
Comments
Moving this to |
Moved this into |
Upgrading this issue to |
12971: Command distribution improvements r=korthout a=remcowesterhoud ## Description <!-- Please explain the changes you made here. --> These improvements are necessary to distribute commands using the CommandDistributionBehavior. The commits are extracted from the following pull request to reduce its size and unblock other topics: - #11962 ## Related issues <!-- Which issues are closed by this PR or are related --> relates to #11456 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
13207: Distribute DMN resource deletions r=remcowesterhoud a=remcowesterhoud ## Description <!-- Please explain the changes you made here. --> With the (almost) completion of #11456 we are now able to use this upon deleting a resource. As of this time only DMN resource deletion is implemented. This PR does some refactorings to this code and adds the distribution and acknowledgements. I recommend reviewing this per commit. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #13204 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
13207: Distribute DMN resource deletions r=remcowesterhoud a=remcowesterhoud ## Description <!-- Please explain the changes you made here. --> With the (almost) completion of #11456 we are now able to use this upon deleting a resource. As of this time only DMN resource deletion is implemented. This PR does some refactorings to this code and adds the distribution and acknowledgements. I recommend reviewing this per commit. ## Related issues <!-- Which issues are closed by this PR or are related --> closes #13204 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@korthout do we want to close this epic and leave the remaining issue as a standalone improvement? |
I'm investigating a small regression (max deployable resource payload reduced from ~2MB to ~1.4MB on multi-partition clusters) due to We can keep it separate but might be good just to track it here until completed. |
We can track #13233 separately. Let's close this epic! 🎉 |
* refactor: remove unused event based process endpoints relates to #11456 * chore: use event batch delete endpoint in e2e cleanup * chore: fix PMD comments --------- Co-authored-by: Michał Konopski <michal.konopski@camunda.com>
Description
We know how to generalize the deployment distribution concept to use it for all record value types. The next step is to break this down into technical tasks.
Open questions
maxMessageSize
twice as fast?For deployment, the proposal requires us to write the deployed resources twice in the same record batch, i.e. once in the
Process:Created
(orDecisionRequirements:Created
) events, and once in theRecordDistribution:Started
event. That means that we reach themaxMessageSize
twice as fast. In other words, users will no longer be able to deploy some of the resources they could before. The team proposes to solve this by doubling the currentmaxMessageSize
. We will discuss this with the Zeebe Distributed Platform team, as they may challenge this.ZDP has suggested to:
Which it will be is not yet decided.
Although this question is unanswered, we've decided to move forward without using this
This question came up while deciding 'can we de-deprecate a method in the InterPartitionCommandSender?': Instead of processing distributed commands differently by adding a post-commit task to Acknowledge the command, we could treat the distributed command like other user commands and respond to it. Instead of sending the response to the gateway, it would write a command to another partition.
Yes, we will de-deprecate the method
Another topic that should be discussed with the Zeebe Distributed Platform (ZDP) team is de-deprecating the method to send a command to another partition where the sending partition determines the record key. This method was deprecated immediately when it was introduced with the new InterPartitionCommandSender API to avoid us from using it for other cases than Deployment Distribution. However, we could not figure out the reason why this method should not be used. Actually, the team sees reasonable use cases where a partition can decide the record key when it sends it to another partition. As the key encodes the partition id it was generated on, it clearly identifies an entity to exist on that specific partition. We should discuss this with the Zeebe Distributed Platform team to understand why this method was deprecated in the first place and push to revise that stance.
After discussing with ZDP, we agreed that it is necessary for Deployments to re-use the key. The deployment must be available on all partitions with the same key. Otherwise, resource deletion would not be possible because we somehow need to refer to a single resource (Deployment). Initially, we thought it must also be available for process creation, but the process key is already part of the
ProcessMetadata
which is part of theDeployment
command that is distributed to the other partitions.Also part of the decision is that we clearly document the usage of this method. When is it allowed to use it and when not. It must also be clear why the method must exist.
For full details of the discussion, please find the associated (archived) Slack channel #top-zeebe-dedeprecate-send-command-with-key.
Concept and goal
Some entities in Zeebe are cross-cutting partitions. For example, when you deploy a new Process, you want to be able to start Process Instances of that Process on any of the partitions. But the gateway writes the
Deployment:Create
command only on a single partition when it handles a call to theDeployResource RPC
. The engine has to communicate this command to the other partitions (i.e. each partition has its own engine). This communication is unreliable because of the nature of distributed systems. We need a way to communicate commands between the partitions reliably. We call this mechanism command distribution.Several features require this same mechanism. Instead of building the same logic multiple times, we should generalize the concept to reuse it for all of these. This maintenance task will unblock:
We can achieve this with the following proposed solution:
Introduce a new value type called
CommandDistribution
, which wraps the command we want to communicate reliably to other partitions.An initial
STARTED
intent ensures we store that command in the state (for lookups at retry), and a finalFINISHED
event can be applied to remove this command from the state.Then, for every partition, we have intents
DISTRIBUTING
,ACKKNOWLEDGE
, andACKNOWLEDGED
to keep track of the distribution to that specific partition.On the receiving partition, we write the encapsulated command directly. Its key contains the information that it was distributed (and from which partition), so the engine knows the send the
ACKNOWLEDGE
back to the distributing partition.Task breakdown
Tasks
RecordDistribution
record zeebe#11657RecordDistribution
events zeebe#11658Deployment:Create
processor to new record distribution behavior zeebe#11661The text was updated successfully, but these errors were encountered: