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

Implement handling of lease grant responses on placement driver side

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • None

    Description

      The active actor of placement driver should handle lease grant responses from replicas, other nodes of placement driver should discard such messages.

      Lease grant response should either contain "ok" acceptance flag, meaning that the replica (leaseholder candidate) accepted the assigned role of primary replica, or redirect proposal, meaning that the replica proposes another node, which is a member of replication group, for this role. In the first case, the placement driver should make the invoke to meta storage in order to promote the leaseholder candidate to actual leaseholder, with the same lease expiration timestamp as it was initiated for candidate. In the second case, the placement driver should consider the redirect proposal using leaseholder balancer (see IGNITE-18879 ) and make decision to assign the candidate to the proposed node (and send a new LeaseGrantMessage to it) or force assign the leaseholder role to the same candidate. 

      Pseudocode:

       

      onLeaseGrantResponse(leaseGrantResponse) {
          leaseExpirationTime = leaseGrantResponse.leaseExpirationTime
          if (leaseGrantResponse.redirectProposal) {
              leaseCandidateNew = leaseBalancer.considerRedirectProposal(leaseGrantResponse.sender, leaseGrantResponse.redirectProposal);
              if (invokeMetaStorage(grantLease(leaseCandidateNew, leaseExpirationTime))) {
                  sendLeaseGrantMessage(leaseCandidateNew, leaseExpirationTime, force) // force lease grant message
              }
          } else {
              assert(leaseGrantResponse.accepted)
              leaseholder = leaseGrantResponse.sender
              invokeMetaStorage(leaseConfirmed(leaseholder, leaseExpirationTime))
          }
      }

       

       

      Attachments

        Issue Links

          Activity

            People

              v.pyatkov Vladislav Pyatkov
              Denis Chudov Denis Chudov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m