[ https://issues.apache.org/jira/browse/RATIS-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16339121#comment-16339121 ]
Lokesh Jain edited comment on RATIS-203 at 1/25/18 11:58 AM: ------------------------------------------------------------- Possible solution for first scenario is that when a log entry is truncated we complete the corresponding retry cache entry future with an exception. For the second scenario we probably need a timeout like functionality. was (Author: ljain): Possible solution for first scenario is that when a log entry is truncated we complete the corresponding retry cache entry future with an exception. > RaftClient request may wait indefinitely for a reply > ---------------------------------------------------- > > Key: RATIS-203 > URL: https://issues.apache.org/jira/browse/RATIS-203 > Project: Ratis > Issue Type: Bug > Reporter: Lokesh Jain > Assignee: Lokesh Jain > Priority: Major > > There are two scenarios which can lead to such a situation. > # Raft leader accepts an entry and puts it in its retry cache. But it fails > or changes before it can append the entries to its follower. In such a case > the entry would remain in its retry cache. If this leader is chosen again by > the ring, any subsequent request by the raft client would wait indefinitely > for the future in retry cache entry to complete. > # The leader receives the request but dies before replying to it. > Below are the log entries corresponding to first scenario. > {code:java} > 2018-01-25 16:28:55,479 DEBUG impl.RaftServerImpl > (LeaderState.java:addPendingRequest(239)) - s2: addPendingRequest at > index=3255, request=RaftClientRequest(client-C496AD50C41A->s2) in > group-8A72B1078A40, cid=3554, seq=293 RW, 322d323933 > 2018-01-25 16:28:57,457 DEBUG impl.RaftServerImpl > (RaftServerImpl.java:submitClientRequestAsync(476)) - s2: receive client > request(RaftClientRequest(client-C496AD50C41A->s2) in group-8A72B1078A40, > cid=3554, seq=293 RW, 322d323933) future client-C496AD50C41A:3554:pending > passedjava.util.concurrent.CompletableFuture@404d76c7[Not completed] > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)