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 main] Allow retried DMN resource distribution #9887

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Description

Backport of #9883 to main.

relates to #9877

lenaschoenburg and others added 2 commits July 26, 2022 08:15
A critical bug was found related to redistributing DMN resources. When
the distribution isn't acknowledged, it is retried until it is. This
retry also occurs on the restart of the deployment partition, if the
deployment distribution hasn't been completed for that partition yet.

This retry results in an additional distribute deployment command on the
other partition. Once processed it writes the DISTRIBUTED event which
when applied inserts the decision and drg into the state. The second
time the event is written again and applied again, in which case the
insert fails due to consistency checks of the insert method.

This test doesn't check the implementation of the insert (using the
insert method), but checks the behavior. If the insert fails then it
also doesn't write the DISTRIBUTED event, as the exception will make
sure the entire transaction is rolled back. This test verifies that the
DISTRIBUTED event is correctly written to the log and so without errors.
It actually checks that this event is written twice, after the command
was written twice. After this we can be sure that the retried
distribution of the dmn resource in the deployment was succesfully
processed.

Note that this solution differs from the alternative: rejecting the
retried DISTRIBUTE command if the resources are already known. However,
this solution is more complex and not suitable for patching a critical
bug. We can have a look at that solution in future versions.

Co-authored-by: Nico korthout <nico.korthout@camunda.com>
(cherry picked from commit 9fd942c)
This fixes critical a critical bug, where a decision and/or drg can be
inserted twice due to retry logic for inter-partition distribution of
deployments. To counter act, this allows an overwrite of existing
values.

See #9877 and DeploymentClusteredTest.shouldDistributeDmnResourceOnRetry.

(cherry picked from commit 0e60752)
Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

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

LGTM 🤖

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 6ce8a1a into main Jul 26, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the backport-9883-to-main branch July 26, 2022 08:50
@korthout korthout changed the title [Backport main] [stable/8.0] Allow retried DMN resource distribution [Backport main] Allow retried DMN resource distribution Jul 26, 2022
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