Skip to content
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

[Backport stable/8.1] Distribute deployment in post commit tasks #10711

Merged
merged 1 commit into from Oct 13, 2022

Conversation

backport-action
Copy link
Collaborator

Description

Backport of #10689 to stable/8.1.

relates to #9964

This change makes it so that we do not distribute a deployment during the processing of the CREATE command, but as post commit task afters this command has been processed.

The reasoning behind this change is that the writing of the deployment distribution events/commands could happen in an unexpected order. This is because of the event buffering. Once we write an event this gets buffered. When we notify a different partition about the deployment it will write (and possibly process) the command immediately. This results in a situation where the different partition could write it's commands/events before we commands/events of the CREATE command have been written, making the ordering seem backwards.

E.g.:
1. We receive a Deployment.CREATE command

2. During processing we will write the DeploymentDistribution.DISTRIBUTING event. During processing we also send a message to the other partitions in order to distribute the deployment.

3. The DeploymentDistribution.DISTRIBUTING event is written to the buffer. Nothing is written to the log stream yet. The other partition receives the message and writes a Deployment.DISTRIBUTE command. At this point this partition is idle so it will immediately start processing this command.

4. Here we run into a race condition. If the second partition sends the response back to the first partition before the first partition has finished processing the Deployment.CREATE command it will write the DeploymentDistribution.COMPLETE before it writes the buffered events.

(cherry picked from commit 33070a4)
@github-actions
Copy link
Contributor

Test Results

   934 files  ±  0     934 suites  ±0   1h 47m 59s ⏱️ -40s
7 261 tests  - 81  7 253 ✔️  - 81  8 💤 ±0  0 ±0 
7 449 runs   - 81  7 441 ✔️  - 81  8 💤 ±0  0 ±0 

Results for commit 918f864. ± Comparison against base commit f9e2d3d.

Copy link
Contributor

@remcowesterhoud remcowesterhoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 533e22d into stable/8.1 Oct 13, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the backport-10689-to-stable/8.1 branch October 13, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants