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

[stable/8.2] Allow decision requirements in column family 49 #16411

Merged
merged 5 commits into from Feb 16, 2024

Conversation

korthout
Copy link
Member

@korthout korthout commented Feb 16, 2024

Description

Fixes a bug in ColumnFamily49Corrector where it falsely detected a correct DRG entry in column family 49 as an entry that should be moved to PROCESS_INSTANCE_KEY_BY_DEFINITION_KEY.

  • 7bdbf0f should surface the bug, but runs into an issue with test setup where it uses a count method that attempts to deserialize the key/value pair but fails
  • a0f8adf and 22af24c fix that problem, after which the bug actually surfaces in the test case
  • 7f64ab4 fixes the bug
  • 94a79c7 adds extra assertions to the test case

Changes have been tested manually locally against the data folder of the affected cluster.

Related issues

closes #16406

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Other teams:
If the change impacts another team an issue has been created for this team, explaining what they need to do to support this change.

Please refer to our review guidelines.

@korthout korthout changed the base branch from main to stable/8.2 February 16, 2024 12:12
@korthout korthout changed the title Allow decision requirements in column family 49 [stable/8.2] Allow decision requirements in column family 49 Feb 16, 2024
This test case was not surfacing a bug due to usage of a specific
user-defined string as the decisionRequirementsId. This meant that the
correct data did not trigger the false positive where it would be
attempted to be moved.
We need to be able to count the entries in the column family regardless
of whether they can be deserialized. To do so, I copied these methods
from main.
This count method avoids deserialization and can thus verify incorrect
data
@korthout korthout force-pushed the korthout-16406-allow-drgs-in-cf-49 branch from f9f6ca1 to 87a08e9 Compare February 16, 2024 12:12
Previously, this code tried to move the data if it did not match the
processInstanceKeyByProcessDefinitionKey but actually it should move it
when it does match that.

another way to look at it, is that it should leave entries that match
the decisionRequirementsIdAndVersion key should be left alone because
they belong in this column family. Only entries that cannot be matched
to the decisionRequirementsIdAndVersion should be moved.
Adds another assertion to verify that the data that is not moved by the
corrector is the entries that we expect to stay in the column family
(i.e. the correct data)
@korthout korthout force-pushed the korthout-16406-allow-drgs-in-cf-49 branch from 87a08e9 to 94a79c7 Compare February 16, 2024 12:14
@korthout korthout marked this pull request as ready for review February 16, 2024 12:28
Copy link
Member

@Zelldon Zelldon left a comment

Choose a reason for hiding this comment

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

Thanks @korthout good job in root-causing and resolving it so quick 🚀

One question I had, please see below.

@@ -272,7 +272,7 @@ void shouldMovePiKeyByProcDefKeyToCorrectColumnFamily() {
@Test
void shouldIgnoreProcessInstanceKeyByDefinitionKeyEntries() {
// given
decisionRequirementsId.wrapString("decisionRequirements");
Copy link
Member

Choose a reason for hiding this comment

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

❓ Is this because the length is too large and it would catch it already before (on the length)?

Copy link
Member

Choose a reason for hiding this comment

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

If this is the case, could we still have both? So we test all paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@Zelldon Do you think we need another resolution? Or shall I merge?

Copy link
Member Author

Choose a reason for hiding this comment

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

If this is the case, could we still have both? So we test all paths?

Well, we could do that 👍

Copy link
Member

Choose a reason for hiding this comment

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

How 🤔 processInstanceKeyByProcessDefinitionKey is a Long + Long ? So 16 length🤔 decisionRequirements would be 20 chars + the length in front. I'm wondering why this works.

Copy link
Member Author

@korthout korthout Feb 16, 2024

Choose a reason for hiding this comment

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

Wrapping is limited by a maximum, but not an exact size. So, if it can fit the first 16 bytes as two longs than it's fine

Copy link
Member Author

Choose a reason for hiding this comment

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

By the way, I tried with the original string, and that passed as well. I don't want to add it now, because it doesn't matter and slows down the release. Let's just merge this.

@korthout korthout added this pull request to the merge queue Feb 16, 2024
Merged via the queue into stable/8.2 with commit c1da082 Feb 16, 2024
30 checks passed
@korthout korthout deleted the korthout-16406-allow-drgs-in-cf-49 branch February 16, 2024 13:59
@backport-action
Copy link
Collaborator

Backport failed for stable/8.1, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin stable/8.1
git worktree add -d .worktree/backport-16411-to-stable/8.1 origin/stable/8.1
cd .worktree/backport-16411-to-stable/8.1
git checkout -b backport-16411-to-stable/8.1
ancref=$(git merge-base a6bf0e89de97a828888476876466f21b6b32eb5b 94a79c727e6cd6bee66b6a084c7a6195b1b1d562)
git cherry-pick -x $ancref..94a79c727e6cd6bee66b6a084c7a6195b1b1d562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version:8.2.23 Label that represents issues released on verions 8.2.23
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to correct prefix of column family [49]
4 participants