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

kvs-watch: Add flag to only respond to changes to a key #1847

Closed
chu11 opened this issue Nov 19, 2018 · 7 comments
Closed

kvs-watch: Add flag to only respond to changes to a key #1847

chu11 opened this issue Nov 19, 2018 · 7 comments
Assignees

Comments

@chu11
Copy link
Member

chu11 commented Nov 19, 2018

While working on #1653, I realized that the new kvs-watch responds whenever a key has been written to. This includes when the key has the same value written to it. For example:

flux kvs put a=1
flux kvs put a=1
flux kvs put a=1
flux kvs put a=1

Would respond with 4 results to a watcher. In a number of circumstances, I doubt this is what is desired.

Once #1653 is completed, it would be trivial to add a flag to say "only respond if the key value has changed",

@garlick
Copy link
Member

garlick commented Nov 20, 2018

I agree that would be useful to have as a separate flag.

@garlick
Copy link
Member

garlick commented Nov 20, 2018

FLUX_KVS_WATCH_UNIQ?

@chu11
Copy link
Member Author

chu11 commented Nov 20, 2018

FLUX_KVS_WATCH_UNIQ

Actually, this sounds pretty good. B/c it sort of maps to the uniq command and eliminates "repeated lines".

@grondo
Copy link
Contributor

grondo commented Nov 20, 2018

Just thinking aloud again with a focus on typical use cases --should UNIQ be the default behavior?

@chu11
Copy link
Member Author

chu11 commented Nov 20, 2018

I thought about that last night. I figure the majority of the time, duplicate values won't be written to the same key, so we probably don't want to introduce a memcmp() into the middle of that code path?

@grondo
Copy link
Contributor

grondo commented Nov 20, 2018

Yeah, I don't know the right answer, but just wanted to bring it up.

@garlick
Copy link
Member

garlick commented Nov 20, 2018

I don't have a strong opinion on that one, though I would tend to think the extra overhead is not justified when producer and consumer of KVS data are coordinated (like event logs for example).

@chu11 chu11 self-assigned this Nov 20, 2018
chu11 added a commit to chu11/flux-core that referenced this issue Nov 20, 2018
Support new flag that will only send watch responses if the key value
differs from the prior response.

Fixes flux-framework#1847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants