Skip to content
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

Is the order of replies to watch requests strict ? #8745

Closed
socketpair opened this issue Oct 23, 2017 · 7 comments
Closed

Is the order of replies to watch requests strict ? #8745

socketpair opened this issue Oct 23, 2017 · 7 comments

Comments

@socketpair
Copy link

i.e. if I pass multiple watch requests in same http/2 stream, is the order of replies guarantied ?

Answer to this question must be highlited in documentation. It is very important for getting right watch_id for each request if watches are created in parallel.

@socketpair socketpair changed the title Does the order of replies to requests for watch is strict ? Is the order of replies to watch requests strict ? Oct 23, 2017
@xiang90
Copy link
Contributor

xiang90 commented Oct 24, 2017

i am not exactly sure what do you mean. can you clarify?

@socketpair
Copy link
Author

Etcd watch API requires us to use stream-steram GRPC API. This mean that creation of two watchers will look like sending two requests of watcher creation in SINGLE http/2 stream. After that, two responses (about successful watcher creation) will be sent by etcd inside that HTTP/2 stream. I'm asking about order of these replies. I'm asking if order of replies strictly match order of requests. In other words, is it possible to have next situation:

-> create watch on key "xxx"
-> create watch on key "yyy"
<- watch on "yyy" created with watch_id=2
<- watch on "xxx" created with watch_id=1

or even worse (note different order of watch_id)

-> create watch on key "xxx"
-> create watch on key "yyy"
<- watch on "yyy" created with watch_id=1
<- watch on "xxx" created with watch_id=2

@xiang90
Copy link
Contributor

xiang90 commented Oct 24, 2017

the current implementation does guarantee about this ordering. however, it might change later on.

what we suggested is to create watch one by one none concurrently, or wait for #8662 to land.

@xiang90 xiang90 closed this as completed Oct 24, 2017
@socketpair
Copy link
Author

Please reopen issue. This fact must be specified in documentation.

@xiang90
Copy link
Contributor

xiang90 commented Oct 24, 2017

where in the doc says the ordering is guaranteed?

#8662 is well covered the fact. if you think the doc needs to be improved, please open an issue/pr to fix it. thank you.

@socketpair
Copy link
Author

docs does not say anything about order. Why not to fix docs (specify that order is strict) using this issue number ?

@xiang90
Copy link
Contributor

xiang90 commented Oct 24, 2017

the doc improvement is here: https://github.com/coreos/etcd/pull/8662/files#diff-c60cc9a0d9c8fe4cdedc8b5944475568R676

i am not sure what you want. i would suggest you to read through the issue i provided, and the pr to fix it. if you need anything more, make a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants