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

flux-kvs: Should we normalize keys when we output them #1447

Open
chu11 opened this issue Apr 11, 2018 · 2 comments
Open

flux-kvs: Should we normalize keys when we output them #1447

chu11 opened this issue Apr 11, 2018 · 2 comments

Comments

@chu11
Copy link
Member

chu11 commented Apr 11, 2018

Brought up in #1444, @garlick noted:

$ flux kvs dir ns:foo/..
ns:foo/..a = b

Unlike #1391, this is due to the fact that we don't normalize keys when we output them to the user. For example:

>flux kvs ls -R resource......hwloc...xml
resource......hwloc...xml:
0    1    2    3

"key normalization" was handled in #1182 (solving #1173 and #1180) on the server side for the purpose of parsing a user's input. But it was not handled on the client side when outputting a user's input.

Should we normalize the key before outputting? On the one hand it seems the right thing to do, as it outputs what the server side interprets. On the other hand, we're simply outputting whatever the user input. So perhaps the behavior should stay the way it is.

Or another idea, should it be an error when a non-normalized key is passed in by the user? That way there is never any confusion from the client side. Should this be handled in libkvs or is only a flux-kvs behavior?

Also, what should we consider normalized vs non-normalized? Double periods are obviously bad. But periods at the end of the key? I would lean to ok on those.

@chu11
Copy link
Member Author

chu11 commented Nov 27, 2018

idea: always normalize a key on output, but output warning to stderr saying "normalizing input to normalized"? Will require bunch of "normalize the key" calls and strcmps.

@chu11
Copy link
Member Author

chu11 commented Nov 27, 2018

or ... perhaps the response from kvs.lookup and equivalent could return the normalized key? Perhaps that's too much work.

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

1 participant