lni / dragonboat

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

Last index of the replicas #351

Closed antmat closed 1 month ago

antmat commented 2 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 1 month 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 1 month 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.