Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-20365

Add ability to intentionally change primary replica

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              alapin Alexander Lapin
              alapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: