-
Notifications
You must be signed in to change notification settings - Fork 136
IGNITE-20422 Add events of becoming and ceasing to be a primary replica in the PlacementDriver #2596
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
Conversation
...-api/src/main/java/org/apache/ignite/internal/placementdriver/event/PrimaryReplicaEvent.java
Outdated
Show resolved
Hide resolved
| ) { | ||
| when(msm.recoveryFinishedFuture()).thenReturn(completedFuture(0L)); | ||
| when(msm.invoke(any(), any(Operation.class), any(Operation.class))).thenReturn(completedFuture(true)); | ||
| when(msm.getLocally(any(), anyLong())).then(invocation -> emptyMetastoreEntry()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to mock this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid getting null in Entry entry = msManager.getLocally(PLACEMENTDRIVER_LEASES_KEY, recoveryRevision);, which will lead to NPE.
https://issues.apache.org/jira/browse/IGNITE-20422
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
- 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.
Notes