duongkame commented on PR #1011:
URL: https://github.com/apache/ratis/pull/1011#issuecomment-1892686416

   Moved back to draft to debug a relevant error. Somehow 
TestRaftWithSimulatedRpc (testWithLoad and testOldLeaderNotCommit) creates a 
situation which two log entries (different terms) come to a server for the same 
index. The later fails because the TransactionContext has already already 
created and cached for the first one. 
   This seems to be always the case, but now starts to be exposed because now 
we apply referent count for appendEntries. 
   @szetszwo 
   
   ```
   Caused by: java.lang.IllegalStateException: entry.term: expected == 4 but 
computed == 5
        at org.apache.ratis.util.Preconditions.assertTrue(Preconditions.java:76)
        at org.apache.ratis.util.Preconditions.assertSame(Preconditions.java:81)
        at 
org.apache.ratis.statemachine.TransactionContext.wrap(TransactionContext.java:104)
        at 
org.apache.ratis.statemachine.impl.TransactionContextImpl.wrap(TransactionContextImpl.java:136)
        at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.appendEntryImpl(SegmentedRaftLog.java:434)
        at 
org.apache.ratis.server.raftlog.RaftLogBase.lambda$appendEntry$11(RaftLogBase.java:351)
        at 
org.apache.ratis.server.raftlog.RaftLogSequentialOps$Runner.runSequentially(RaftLogSequentialOps.java:78)
        at 
org.apache.ratis.server.raftlog.RaftLogBase.appendEntry(RaftLogBase.java:351)
        at 
org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.appendImpl(SegmentedRaftLog.java:477)
        at 
org.apache.ratis.server.raftlog.RaftLogBase.lambda$append$12(RaftLogBase.java:358)
        at 
org.apache.ratis.server.raftlog.RaftLogSequentialOps$Runner.runSequentially(RaftLogSequentialOps.java:69)
        at 
org.apache.ratis.server.raftlog.RaftLogBase.append(RaftLogBase.java:358)
        at 
org.apache.ratis.server.impl.RaftServerImpl.appendEntriesAsync(RaftServerImpl.java:1653)
        at 
org.apache.ratis.server.impl.RaftServerImpl.appendEntriesAsync(RaftServerImpl.java:1517)
        at 
org.apache.ratis.server.impl.RaftServerImpl.appendEntries(RaftServerImpl.java:1500)
        at 
org.apache.ratis.server.impl.RaftServerProxy.appendEntries(RaftServerProxy.java:663)
        at 
org.apache.ratis.server.simulation.SimulatedServerRpc$1.handleRequest(SimulatedServerRpc.java:163)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to