[ 
https://issues.apache.org/jira/browse/IGNITE-16678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vyacheslav Koptilin reassigned IGNITE-16678:
--------------------------------------------

    Assignee: Alexander Lapin

> org.apache.ignite.raft.client.service.RaftGroupService#transferLeadership 
> doesn't work
> --------------------------------------------------------------------------------------
>
>                 Key: IGNITE-16678
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16678
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Alexander Lapin
>            Assignee: Alexander Lapin
>            Priority: Major
>              Labels: ignite-3
>
> There are three items to fix:
>  * Request preparation.
>  ** leaderId should contain current leader instead of new one.
>  ** peer parameter that is used as new leader is missing
>  * invoke sends given request to an inappropriate node: new leader instead of 
> current one.
>  * exception response doesn't propagate to client.
> In other words instead of
> {code:java}
> TransferLeaderRequest req = factory.transferLeaderRequest()
>     .groupId(groupId).leaderId(PeerId.fromPeer(newLeader).toString()).build();
> CompletableFuture<NetworkMessage> fut = 
> cluster.messagingService().invoke(newLeader.address(), req, rpcTimeout);
> return fut.thenCompose(resp -> {
>     if (resp != null) {
>         RpcRequests.ErrorResponse resp0 = (RpcRequests.ErrorResponse) resp;
>         if (resp0.errorCode() != RaftError.SUCCESS.getNumber())
>             CompletableFuture.failedFuture( {code}
> we should use
> {code:java}
> TransferLeaderRequest req = factory.transferLeaderRequest()
>         .groupId(groupId)
>         .leaderId(PeerId.fromPeer(leader).toString())
>         .peerId(PeerId.fromPeer(newLeader).toString())
>         .build();
> CompletableFuture<NetworkMessage> fut = 
> cluster.messagingService().invoke(leader.address(), req, rpcTimeout);
> return fut.thenCompose(resp -> {
>     if (resp != null) {
>         RpcRequests.ErrorResponse resp0 = (RpcRequests.ErrorResponse) resp;
>         if (resp0.errorCode() != RaftError.SUCCESS.getNumber())
>             return CompletableFuture.failedFuture( {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to