You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Lokesh Jain (JIRA)" <ji...@apache.org> on 2017/11/30 08:28:00 UTC

[jira] [Updated] (RATIS-160) Retry cache should handle leader change after log commit

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

Lokesh Jain updated RATIS-160:
------------------------------
    Description: 
This jira is in relation to the below exception seen in the logs. 

{code:java}
java.lang.IllegalStateException: retry cache entry should be pending: client-89341C13-2136-4EF3-BD8A-73C2526B7703:1777:done
        at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:60)
        at org.apache.ratis.server.impl.RetryCache.getOrCreateEntry(RetryCache.java:169)
        at org.apache.ratis.server.impl.RaftServerImpl.replyPendingRequest(RaftServerImpl.java:915)
        at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:974)
        at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:151)
        at java.lang.Thread.run(Thread.java:748)
Exception in thread "StateMachineUpdater-s3" org.apache.ratis.util.ExitUtils$ExitException: StateMachineUpdater-s3: the StateMachineUpdater hits Throwable
        at org.apache.ratis.util.ExitUtils.terminate(ExitUtils.java:94)
        at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:175)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: retry cache entry should be pending: client-89341C13-2136-4EF3-BD8A-73C2526B7703:1777:done
        at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:60)
        at org.apache.ratis.server.impl.RetryCache.getOrCreateEntry(RetryCache.java:169)
        at org.apache.ratis.server.impl.RaftServerImpl.replyPendingRequest(RaftServerImpl.java:915)
        at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:974)
        at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:151)
        ... 1 more
{code}

This occurs when leader commits a log entry but is not able to send a reply to the client before leader is changed. When the new leader gets the request it sends the append entry request to the followers whose cache already has the  corresponding entry leading to the above exception.

> Retry cache should handle leader change after log commit
> --------------------------------------------------------
>
>                 Key: RATIS-160
>                 URL: https://issues.apache.org/jira/browse/RATIS-160
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Lokesh Jain
>            Assignee: Lokesh Jain
>
> This jira is in relation to the below exception seen in the logs. 
> {code:java}
> java.lang.IllegalStateException: retry cache entry should be pending: client-89341C13-2136-4EF3-BD8A-73C2526B7703:1777:done
>         at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:60)
>         at org.apache.ratis.server.impl.RetryCache.getOrCreateEntry(RetryCache.java:169)
>         at org.apache.ratis.server.impl.RaftServerImpl.replyPendingRequest(RaftServerImpl.java:915)
>         at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:974)
>         at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:151)
>         at java.lang.Thread.run(Thread.java:748)
> Exception in thread "StateMachineUpdater-s3" org.apache.ratis.util.ExitUtils$ExitException: StateMachineUpdater-s3: the StateMachineUpdater hits Throwable
>         at org.apache.ratis.util.ExitUtils.terminate(ExitUtils.java:94)
>         at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:175)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalStateException: retry cache entry should be pending: client-89341C13-2136-4EF3-BD8A-73C2526B7703:1777:done
>         at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:60)
>         at org.apache.ratis.server.impl.RetryCache.getOrCreateEntry(RetryCache.java:169)
>         at org.apache.ratis.server.impl.RaftServerImpl.replyPendingRequest(RaftServerImpl.java:915)
>         at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:974)
>         at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:151)
>         ... 1 more
> {code}
> This occurs when leader commits a log entry but is not able to send a reply to the client before leader is changed. When the new leader gets the request it sends the append entry request to the followers whose cache already has the  corresponding entry leading to the above exception.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)