Skip to content

Commit

Permalink
Fix to bug in handle_cli_req (#526)
Browse files Browse the repository at this point in the history
* When a leader invokes `end_of_append_batch`, the first parameter
represents the starting index of the batch. There was missing `+1`.
  • Loading branch information
greensky00 authored Jul 30, 2024
1 parent bd8fb29 commit a4029e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handle_client_request.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ptr<resp_msg> raft_server::handle_cli_req(req_msg& req,
}
}
if (num_entries) {
log_store_->end_of_append_batch(last_idx - num_entries, num_entries);
log_store_->end_of_append_batch(last_idx - num_entries + 1, num_entries);
}
try_update_precommit_index(last_idx);
resp_idx = log_store_->next_slot();
Expand Down

0 comments on commit a4029e1

Please sign in to comment.