Skip to content

IGNITE-20866 Resolved a race condition issue in the cluster configuration initialization process#2844

Merged
tkalkirill merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-20866
Nov 15, 2023
Merged

IGNITE-20866 Resolved a race condition issue in the cluster configuration initialization process#2844
tkalkirill merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-20866

Conversation

@ivgag
Copy link
Contributor

@ivgag ivgag commented Nov 15, 2023

https://issues.apache.org/jira/browse/IGNITE-20866

Previously, the configuration was applied locally when the meta-storage revision was 0, leading to potential race conditions and the configuration being ignored if the revision changed.

Changes made:

  • Altered the initialization logic to first check for the local revision of the configuration key.
  • If the local revision is absent, the system now falls back to the initial configuration.

This fix ensures more reliable and consistent application of the cluster configuration, particularly during initialization phases where the meta storage revision is susceptible to change.

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

…tion initialization process. Previously, the configuration was applied locally when the meta storage revision was 0, leading to potential race conditions and the configuration being ignored if the revision changed.

Changes made:
- Altered the initialization logic to first check for the local revision of the configuration key.
- If the local revision is absent, the system now falls back to the initial configuration.

This fix ensures more reliable and consistent application of the cluster configuration, particularly during initialization phases where the meta storage revision is susceptible to change.
// condition for update.
// Joining all of the above, it's concluded that the following condition must be used:
Condition condition = curChangeId == 0L
Condition condition = changeId == 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it correct to delete the entire comment that was previously there?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd ask to re-formulate the Current node has already performed some updates or received them from MetaStorage watch listener. Simple Otherwise would do it.
Deleted part of the comment makes no sense after the fix, this is fine

@tkalkirill tkalkirill merged commit 75d50f1 into apache:main Nov 15, 2023
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.

3 participants