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

IGNITE-22928 Fix testZoneReplicaListener #4284

Merged
merged 5 commits into from
Aug 27, 2024
Merged

Conversation

JAkutenshi
Copy link
Contributor

JIRA Ticket: IGNITE-22928 | Fix testZoneReplicaListener

The goal

The goal is to fix the disabled test.

The reason

It fails

The solution

The main issue there is a race between switched primary replica from TestPlacementDriver and internal logic inside of lifecycle managers. The issued zone is default, so a possible solution is to return null primary (no primary) for the default zone and thus there no the race.


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

@JAkutenshi JAkutenshi marked this pull request as ready for review August 26, 2024 13:30
@@ -81,7 +81,11 @@ public CompletableFuture<List<TokenizedAssignments>> getAssignments(
return failedFuture(new UnsupportedOperationException("getAssignments() is not supported in FakePlacementDriver yet."));
}

private CompletableFuture<ReplicaMeta> getPrimaryReplicaMeta() {
private CompletableFuture<ReplicaMeta> getPrimaryReplicaMeta(ReplicationGroupId replicationGroupId) {
if (replicationGroupId instanceof ZonePartitionId && ((ZonePartitionId) replicationGroupId).zoneId() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's name this 0 as a separate DEFAULT_ZONE_ID field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done~

@JAkutenshi JAkutenshi requested a review from kgusakov August 27, 2024 14:20
@sanpwc sanpwc merged commit 8b705e0 into apache:main Aug 27, 2024
1 check passed
@sanpwc sanpwc deleted the ignite-22928 branch August 27, 2024 14:35
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