Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
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
- links to