ZOOKEEPER-4706: Support 64-bit sequential nodes using zxid - #2059
Open
kezhuw wants to merge 1 commit into
Open
Conversation
It is somewhat well-known that ZooKeeper's sequential node number will overflow finally. It is ok for most usages, but it could also be annoying to handle this overflow in client side in certain cases. It would be really nice for ZooKeeper to support 64-bit sequential number to avoid overflow for long running and high frequency usages. This pr introduces new `CreateMode`s to not break existing usages and uses `zxid` as the sequence number to not change on-disk wire format. The consequence is that: * Not consecutive. There could be hole in two adjacent sequential number. * Fail to create through `multi` with same prefix path. But `multi` does not work well with same path modifications anyway. See ZOOKEEPER-4695.
tisonkun
reviewed
Sep 23, 2023
tisonkun
left a comment
Member
There was a problem hiding this comment.
IIRC zxid only use the least significant 32 bit as sequential id, so it's still overflow with Integer.MAX_VALUE bound.
Why do we need this manner since it doesn't release the upper bound.
Member
Author
No, overflow of the lower 32-bits means re-election. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is somewhat well-known that ZooKeeper's sequential node number will overflow finally. It is ok for most usages, but it could also be annoying to handle this overflow in client side in certain cases. It would be really nice for ZooKeeper to support 64-bit sequential number to avoid overflow for long running and high frequency usages.
This pr introduces new
CreateModes to not break existing usages and useszxidas the sequence number to not change on-disk wire format.The consequence is that:
multiwith same prefix path. Butmultidoes not work well with same path modifications anyway. See ZOOKEEPER-4695.ZooKeeper docs about overflow
BookKeeper "depends on" this overflow
BookKeeper's LongZkLedgerIdGenerator will fallback to (or rollover) its long version in case of ephemeral sequence overflow.
Blockers
As I documented above, this pr does not work well with
multi. I created ZOOKEEPER-4695 months ago in discussion of ZOOKEEPER-4655(#1950). If it is good for us to forbid multiple mutations of one key inmulti, I think this pr is possibly promising as it breaks no implicit dependencies and requires no on-disk wire format change.