-
Notifications
You must be signed in to change notification settings - Fork 2
Fix range_end calculation #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
https://github.com/etcd-io/etcd/blob/main/client/v3/op.go#L376 -- it's how etcdctl do it. |
| sort_target: RangeRequestSortTarget = RangeRequestSortTarget.KEY, | ||
| encoding='utf-8', | ||
| ): | ||
| encoded_key = key.encode(encoding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this encode here we already do it inside new function. Same for other cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or new function shouldn't worry about conversion and should consume only bytes
stalkerg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@kyujin-cho please review this PR. |
|
@kyujin-cho sorry, but ping. |
Issue
We are adding +1 to the last byte excluding
/, because of this, we are not receiving events. Escpecially when you set the persmission based on the path like below.role permission
watch prefix for
app_data/clients/clientx2/becomesb'app_data/clients/clientx3/'but it supposed to beb'app_data/clients/clientx30'(As slash is part of the key, we shall add +1 to the slash)Fix
As per etcd3 spec https://etcd.io/docs/v3.3/learning/api/#:~:text=revision%20was%20committed.-,Key%20ranges,-The%20etcd3%20data
Some implementations
https://github.com/etcd-io/etcd/blob/main/client/v3/op.go#L376
https://github.com/gaopeiliang/aioetcd3/blob/4709a2a412cc81d47a8a262e569b4cd62a7659d4/aioetcd3/utils.py#L14