[
https://issues.apache.org/jira/browse/IGNITE-18958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713658#comment-17713658
]
Kirill Gusakov commented on IGNITE-18958:
-----------------------------------------
LGTM
> Implement handling of lease grant responses on placement driver side
> --------------------------------------------------------------------
>
> Key: IGNITE-18958
> URL: https://issues.apache.org/jira/browse/IGNITE-18958
> Project: Ignite
> Issue Type: Improvement
> Reporter: Denis Chudov
> Assignee: Vladislav Pyatkov
> Priority: Major
> Labels: ignite-3
> Time Spent: 40m
> Remaining Estimate: 0h
>
> 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:
>
> {code:java}
> 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))
> }
> }{code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)