[ https://issues.apache.org/jira/browse/IGNITE-20365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17835638#comment-17835638 ]
Denis Chudov edited comment on IGNITE-20365 at 4/10/24 8:45 AM: ---------------------------------------------------------------- Fixed by IGNITE-21382 . The change of primary replica is possible while using org.apache.ignite.internal.table.NodeUtils#transferPrimary. was (Author: denis chudov): Fixed by IGNITE-21382 . > Add ability to intentionally change primary replica > --------------------------------------------------- > > Key: IGNITE-20365 > URL: https://issues.apache.org/jira/browse/IGNITE-20365 > Project: Ignite > Issue Type: Bug > Reporter: Alexander Lapin > Assignee: Alexander Lapin > Priority: Major > Labels: ignite-3 > > Some tests, e.g. testTxStateReplicaRequestMissLeaderMiss expects primary > replica to be changed. Earlier when primary replica was collocated with > leader refreshAndGetLeaderWithTerm was used in order to change leader and > thus primary replica. Now when Placement driver assigns primary replica it's > no longer the case. All in all, some PlacementDriver#changePrimaryReplica or > similar will be useful, at least within tests. > > *Implementation Details* > +Important note:+ The lease contract prohibits intersecting leases. We don't > want to break this contract, so we will have to wait until the current lease > ends before another replica becomes primary. > There are two ways to implement this functionality - either extend > {{PlacementDriver}} in the product or change only the test code. Looks like > the second approach is not enough if we start a test ignite instance using an > {{IgniteImpl}} class. So we might need to consider extend the production > code. Moreover, such change might become the first step towards a graceful > cluster reconfiguration. > The code that is responsible for managing lease resides in {{LeaseTracker}} > and {{LeaseUpdater}}. To do the required change we can add a pending lease > with the start time in the future. We should make sure that both there > places, as well as any recovery code accounts for it. Now the next lease is > added ONLY when the current one ends. -- This message was sent by Atlassian Jira (v8.20.10#820010)