mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-31 03:56:42 +00:00
This patch introduces `raft_address_map` class to abstract the notion of expirable address mappings for a raft rpc module. In Raft an instance may need to communicate with a peer outside its current configuration. This may happen, e.g., when a follower falls out of sync with the majority and then a configuration is changed and a leader not present in the old configuration is elected. The solution is to introduce the concept of "expirable" updates to the RPC subsystem. When RPC receives a message from an unknown peer, it also adds the return address of the peer to the address map with a TTL. Should we need to respond to the peer, its address will be known. An outgoing communication to an unconfigured peer is impossible. Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>