lni / dragonboat

A feature complete and high performance multi-group Raft library in Go.
Apache License 2.0
5.09k stars 542 forks source link

Last index of the replicas #351

Closed antmat closed 6 months ago

antmat commented 7 months ago

Hi! Is there a way to know LastIndex of the replicas of the raft cluster? We wanted to detect stale nodes in our program, but right now it seems there is no such functionality.

Thanks!

kevburnsjr commented 6 months ago

Operations like this are probably best performed out of band. Just make a request to each node, perform a stale read and compare the results.

lni commented 6 months ago

@antmat

to detect stale node, you can just issue a ReadIndex request on the node and see whether it can be successfully completed. stale nodes will cause the ReadIndex operation to timeout if the "staleness" is more significant than the specified timeout value.