-
Notifications
You must be signed in to change notification settings - Fork 50
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
kvs-watch: support size/offset for watch to begin #6292
Comments
just a brainstorm, a size/offset probably is hard to do. pondering if some type of "credits" on the eventlog watch would work. i.e.
hmmm, off the top of my head it feels harder to implement, but would obviously perform better (size/offset might requires users to start/stop the watcher multiple times). |
while working on #6456, realized there are some core design stuff that makes a size/offset/index very hard to do / will not perform well.
|
Sorry, backing up because I've lost the thread. Is this right?
I think you're right that it would be very inconvenient for What sort of interface did you have in mind to provide to the shell? I assume some variant on |
Yes, this is the "prequel" issue to #6413.
Before hitting these issues, my thought was the user could count the number of events it received or the amount of data it had received. If we would overflow the buffer, stop the watcher. Restart the stdin watcher at some index/offset when we get credits back. We would perhaps have to buffer the "current" data if we've only sent some portion it. |
Hmm, ok. Maybe the client/shell could use an interface offered by Or, instead of canceling and restarting a watch at an offset which could be wasteful if a lot of data gets thrown away on every cancel, maybe we just need a generic way for a streaming RPC to be paused and resumed? Or maybe a flag to reverse it so a streaming RPC starts paused and only sends data when it receives credit? |
The main issue, which I did not realize until working on other things, is that multiple eventlog entries could be inside a single blobref. So it sort of makes going off the treeref index very unreliable.
Good ideas. This is along the lines of a brainstorming idea I had a few comments up, where I put a "credit system" into job info. Although now that you mention it, a "pause" and "resume" is far simpler than a "credits" one. |
Doesn't it just mean when you get the current blob (in job-info), you have to hold onto it and send an event at a time to the consumer, then get the next blob?
Apologies for not keeping up! Actually credits is probably better for the general case and pause resume is like a degenerate case of that with credit = 1 right? |
I'm not following your point. My original point was more with the "restart the watcher" case, b/c multiple events can occur inside each blobref, I cannot pass a "start at event number X" to If you're thinking about the "pause/resume" case,
Yeah, although I think you mean credits = infinity w/ resume and credits = 0 w/ pause. |
Sorry, I probably conflated the two thoughts when I typed that!
Er yeah, was thinking of the reverse I guess where sender starts out paused (zero credits) and has to get a "resume" (credit++) before sending each response, so the credit count oscillates between 0 and 1. |
Per discussion in #4572
The text was updated successfully, but these errors were encountered: