Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RATIS-1873. Remove RetryCache assertion that doesn't hold #904

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

SzyWilliam
Copy link
Member

See https://issues.apache.org/jira/browse/RATIS-1873.

An IllegalStateException is thrown on retry cache entry:

2023-08-14 21:59:51,099 [7@group-000200000003-StateMachineUpdater] ERR0R o.a.r.s.i.StateMachineUpdater:196 - 7@group-000200000003-StateMachineUpdater caught a Throwable. 
org.apache.ratis.server.raftlog.RaftLogIOException: java.lang.IllegalStateException: retry cache entry should be pending: l9@client-D8ECBF42B70A:done
    at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:1780)
    at org.apache.ratis.server.impl.StateMachineUpdater.applyLog(StateMachineUpdater.java:242)
    at org.apache.ratis.server.impl.stateMachineUpdater.run(StateMachineUpdater.java:184)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: retry cache entry should be pending: 19@client-D8ECBF42B70A:done
    at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:60)
    at org.apache.ratis.server.impl.RaftServerImpl.replyPendingRequest(RaftServerImpl.java:1727)
    at org.apache.ratis.server.imp.RaftServerImp1.applyLogTostateMachine(RaftServerImp.java:1778)

This assertion may not remain valid in certain edge cases. For instance, when an apply operation takes too long (such as triggering a blocking snapshot process), the cached entry might expire, leading to the failure of this assertion. Therefore, we should consider changing this arbitrary assertion into a moderate warning.

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

Copy link
Contributor

@codings-dan codings-dan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SzyWilliam SzyWilliam merged commit a6719dc into apache:master Aug 18, 2023
10 checks passed
@SzyWilliam
Copy link
Member Author

@szetszwo @codings-dan Thanks a lot for reviewing this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants