Version 1.0

This commit is contained in:
2026-02-19 15:28:10 +01:00
parent 238e35b581
commit e02e529809
11 changed files with 321 additions and 482 deletions
+10
View File
@@ -79,6 +79,16 @@ process_message(ClientState *state,
return -1;
memcpy(&redirect_message, msg.ptr, sizeof(redirect_message));
// Ignore stale redirects from previous requests. A redirect
// from server A for request N-1 can arrive after the client
// has already moved on to request N with server B. Without
// this check, the stale redirect would falsely cancel the
// current request, causing the client and linearizability
// checker to believe the request was rejected even though
// the new server may have committed it.
if (redirect_message.request_id != state->request_id)
return 0;
if (redirect_message.leader_idx >= 0 && redirect_message.leader_idx < state->num_servers) {
CLIENT_TRACE("Redirected to leader %d", redirect_message.leader_idx);
state->current_leader = redirect_message.leader_idx;