Hi, I'd like to propose (and get feedback on) the idea of having an epoch value in LeaderLatchListener (for the LeaderLatch recipe). The general idea is that LeaderLatchListener would be provided with a monotonically-incrementing value each time it receives leadership. This epoch value can then be used in calls to downstream services, thereby allowing those downstream services to detect a stale leader which hasn't realized that it has lost leadership.
I think Martin Kleppmann can do a much better job of explaining the general concept in his article "How to do distributed locking"[1], specifically in the section titled "Making the lock safe with fencing". I did a small POC implementation[2] to give a better idea of what I'm talking about by just using the Stat.cversion of the main lock node used in LeaderLatch. I'm really interested in hearing any opinions on this, as well as problems with the approach here, and/or other/better ways of doing the equivalent thing, so thanks in advance for that. - Gabriel 1. https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html 2. https://github.com/apache/curator/compare/master...gabrielreid:curator:gabriel.reid/add_epoch_to_leader_latch
