szetszwo commented on PR #1296: URL: https://github.com/apache/ratis/pull/1296#issuecomment-3369938829
Stale read means reading the old value of already changed data. In your example, the data is updated after read. Let's add commit indices: leader (c6) and follower (c4). - At time T0, the leader returns an index (c6) to the follower. - At time T1, the follower (c4) receives this index (c6). - At time T2, the follower’s commitIndex (c4) reaches that index (c6). - At time T3, the follower (c6) finishes the read query and returns the result to the client — - however, by client receiving the response, the leader may have already made changes to c7, such as deleting that file. This is the same as sending the request directly to the leader: - At time T0, the client sends a read request to the leader (c6). - The leader (c6) finishes the read query. - While the packet is stuck in the network due to congestion, the leader has changed to c7. - Client receives the result (c6). -- 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]
