Skip to content

Commit

Permalink
Little fixes try_update_precommit_index method (#285)
Browse files Browse the repository at this point in the history
* fix try_update_precommit_index bug

* fix code style
  • Loading branch information
JackyWoo committed Feb 10, 2022
1 parent b5b74f2 commit cce3af7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handle_append_entries.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ bool raft_server::try_update_precommit_index(ulong desired, const size_t MAX_ATT
size_t num_attempts = 0;
ulong prev_precommit_index = precommit_index_;
while ( prev_precommit_index < desired &&
num_attempts < MAX_ATTEMPTS ) {
(num_attempts < MAX_ATTEMPTS || MAX_ATTEMPTS == 0) ) {
if ( precommit_index_.compare_exchange_strong( prev_precommit_index,
desired ) ) {
return true;
Expand Down

0 comments on commit cce3af7

Please sign in to comment.