sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.53k stars 1.12k forks source link

Does JRaft guarantee idempotency? #1053

Closed ye-xiaowei closed 7 months ago

ye-xiaowei commented 7 months ago

When I send a write request it times out and does a retransmit (network packet loss may have occurred). Will the write be performed 2 times at this point?

fengjiachun commented 7 months ago

sofajraft doesn't guarantee idempotency. Generally, this can be solved at the upper layer. The client can carry a unique id , and the your own stat-machine can make idempotent decisions based on this id.

killme2008 commented 7 months ago

sofajraft doesn't guarantee idempotency. Generally, this can be solved at the upper layer. The client can carry a unique id , and the your own stat-machine can make idempotent decisions based on this id.

As Jiachun said, it's not the issue that jraft or raft algorithm tries to address.