Hi Asad, I guess there are many ways to do the detection. One way is to compare the checksum of the current Raft log (equivalently, the checksum of the current state) as below: - For every log index i, compute checksum_i on each server. Note that checksum_i is the checksum for the entire log from index 0 to index i. - Each server sends (i, checksum_i) to the other servers. - When a server receives (i, checksum_i) from another server. Compare the checksum with its local value.
We may incorporate the checksum in appendEntries -- the leader includes the checksum_i to the log entry with index i. Then, the followers compare the received checksum_i with their local calculation. Hope this helps! Tsz-Wo On Sat, Jul 30, 2022 at 6:55 AM Asad Awadia <[email protected]> wrote: > Hello, > > Not a ratis specific question but let's say I am using raft to replicate > KV across 3 nodes. Simple in memory hash map. > > In theory they should all be at the same state eventually but how does one > verify that assumption? Is my DB consistent across replication? > > How to detect nodes not in sync? And if they are in sync? While live > traffic may be getti g served? > > Regards, > Asad > >
