madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
662 stars 48 forks source link

fix(etcd): fix election implementation #131

Closed wangrunji0408 closed 1 year ago

wangrunji0408 commented 1 year ago

This PR fixes the implementation of etcd election API. Currently, there is only one key for each election. But actually each candidate will create a key and the leader is the one with the smallest revision.

Please note that this implementation is still not exactly as the official etcd, where election API is implemented on top of KV and lease API on the client side.