szetszwo commented on PR #1339: URL: https://github.com/apache/ratis/pull/1339#issuecomment-3864804427
@ss77892 , on second thought, we should not invalidate any cache entries. Ratis retry cache is designed to have unique cache entries. - If a call has replied normally or exceptionally, the calls with the same `ClientInvocationId` should always receive the same result. - For retires, the client always uses a different `ClientInvocationId`. Such design makes thing simple since all the replies are always fixed. In contrast, if we invalidate a NotLeaderException entry. It could cause problem like below: 1. Client sends a call. 2. Server replies NotLeaderException and invalidates the entry. 3. Client has not received the NotLeaderException reply (due to slow network). It retries with the same ClientInvocationId. 4. Server replies replies again with a different result. 5. Client receives the second result. 6. Client receives the NotLeaderException -- 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]
