fix: be conservative on commit progress in appendEntries

This commit is contained in:
Benguang Zhao 2022-12-28 17:47:33 +08:00
parent 6fc47beb71
commit 724cf98dc3
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ _SEND_RESPONSE:
if (accepted && matched) {
pReply->success = true;
// update commit index only after matching
(void)syncNodeUpdateCommitIndex(ths, pMsg->commitIndex);
(void)syncNodeUpdateCommitIndex(ths, TMIN(pMsg->commitIndex, pEntry->index));
}
// ack, i.e. send response