szetszwo commented on PR #1362: URL: https://github.com/apache/ratis/pull/1362#issuecomment-4084585750
> However, the runTestFollowerReadOnlyParallel test failed again for repliedIndex (although it passed for appliedIndex). ... - APPLIED_INDEX passes since the read will wait for the applyTransaction to complete, as shown below. - REPLIED_INDEX fails since it won't -- the test for REPLIED_INDEX will be different. ``` 026-03-18 11:02:43,103 [s1@group-CC1DABE601C3-StateMachineUpdater] INFO statemachine.StateMachine (ReadOnlyRequestTests.java:applyTransaction(216)) - XXX s1: updateLastAppliedTermIndex (t:1, i:3) 2026-03-18 11:02:43,103 [s2@group-CC1DABE601C3-StateMachineUpdater] INFO statemachine.StateMachine (ReadOnlyRequestTests.java:applyTransaction(216)) - XXX s2: updateLastAppliedTermIndex (t:1, i:3) 2026-03-18 11:02:43,188 [s1-client-thread1] DEBUG server.RaftServer$Division (RaftServerImpl.java:submitClientRequestAsyncInternal(960)) - s1@group-CC1DABE601C3: receive client request(RaftClientRequest:client-39500C6A93B4->s1@group-CC1DABE601C3, cid=8, seq=null, RO, Message:5155455259) 2026-03-18 11:02:43,189 [s1-client-thread1] INFO server.GrpcServerProtocolClient (GrpcServerProtocolClient.java:<init>(64)) - Build channel for s0|localhost:15000 2026-03-18 11:02:43,193 [s0-server-thread1] INFO server.RaftServer$Division (LeaderStateImpl.java:getReadIndex(1181)) - XXX readIndex=3 (APPLIED_INDEX=3, readAfterWriteConsistentIndex=null) 2026-03-18 11:02:43,600 [s0@group-CC1DABE601C3-StateMachineUpdater] INFO statemachine.StateMachine (ReadOnlyRequestTests.java:applyTransaction(228)) - XXX s0: Applied (t:1, i:3) command WAIT_AND_INCREMENT, updatedCount=2 2026-03-18 11:02:43,605 [s1@group-CC1DABE601C3-StateMachineUpdater] INFO statemachine.StateMachine (ReadOnlyRequestTests.java:applyTransaction(228)) - XXX s1: Applied (t:1, i:3) command WAIT_AND_INCREMENT, updatedCount=2 2026-03-18 11:02:43,609 [s2@group-CC1DABE601C3-StateMachineUpdater] INFO statemachine.StateMachine (ReadOnlyRequestTests.java:applyTransaction(228)) - XXX s2: Applied (t:1, i:3) command WAIT_AND_INCREMENT, updatedCount=2 ``` > ... I'm still not sure why there is a Thread.sleep(100) in the test or the initial intent behind it. ... The sleep is to let the server update commitIndex/appliedIndex first and make sure the read will wait for it. (Sorry for replying late.) -- 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]
