Github user asdf2014 commented on the issue:
https://github.com/apache/zookeeper/pull/262
Hi, @maoling. Thanks for your discussion. Maybe due to my description is
problematic, so make you confused.
1. I am worry about if the lower 8 bits of the upper 32 bits are divided
into the low 32 bits of the entire `long` and become 40 bits low, there may be
a concurrent problem. Actually, it shouldn't be worried, all operation about
`ZXID` is bit operation rather than `=` assignment operation. So, it cann't be
a concurrent problem in `JVM` level.
2. Yep, it is. Especially, if it is `1k/s` ops, then as long as $2^{32} /
(86400 * 1000) \approx 49.7$ days `ZXID` will exhausted. And more terrible
situation will make the `re-election` process comes early. At the same time,
the "re-election" process could take half a minute. And it will be cannot
acceptable.
3. As so far, it will throw a `XidRolloverException` to force `re-election`
process and reset the `counter` to zero.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---