{"action":"created","issue":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/820","repository_url":"https://api.github.com/repos/flux-framework/flux-core","labels_url":"https://api.github.com/repos/flux-framework/flux-core/issues/820/labels{/name}","comments_url":"https://api.github.com/repos/flux-framework/flux-core/issues/820/comments","events_url":"https://api.github.com/repos/flux-framework/flux-core/issues/820/events","html_url":"https://github.com/flux-framework/flux-core/pull/820","id":178937310,"number":820,"title":"add functions to allow stable KVS namespace traversal","user":{"login":"garlick","id":169947,"avatar_url":"https://avatars.githubusercontent.com/u/169947?v=3","gravatar_id":"","url":"https://api.github.com/users/garlick","html_url":"https://github.com/garlick","followers_url":"https://api.github.com/users/garlick/followers","following_url":"https://api.github.com/users/garlick/following{/other_user}","gists_url":"https://api.github.com/users/garlick/gists{/gist_id}","starred_url":"https://api.github.com/users/garlick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garlick/subscriptions","organizations_url":"https://api.github.com/users/garlick/orgs","repos_url":"https://api.github.com/users/garlick/repos","events_url":"https://api.github.com/users/garlick/events{/privacy}","received_events_url":"https://api.github.com/users/garlick/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flux-framework/flux-core/labels/review","name":"review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-09-23T17:58:44Z","updated_at":"2016-09-23T20:44:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flux-framework/flux-core/pulls/820","html_url":"https://github.com/flux-framework/flux-core/pull/820","diff_url":"https://github.com/flux-framework/flux-core/pull/820.diff","patch_url":"https://github.com/flux-framework/flux-core/pull/820.patch"},"body":"This PR introduces the `kvs_getat()` function, which allows a key to be retrieved relative to a \"treeobj\" directory reference obtained with `kvs_get_treeobj()`.  As described in pr #810, this allows a key to be fetched relative to a \"snapshot\" of the KVS namespace, either the root or a sub-directory.\r\n\r\nIn order to support recursively walking a directory relative to a treeobj, we also needed `kvs_get_dirat()` and `kvs_get_symlinkat()`.  Collectively these new functions solve #64.\r\n\r\nFor convenience, to allow a snapshot of a namespace to be recursively followed using the `kvsdir_*()` functions without breaking existing users, I made it so a `kvsdir_t` established using `kvs_get_dirat()`  retains the treeobj reference so that subsequent `kvsdir_get_*()` calls, including `kvsdir_get_dir()`, are also tied to the treeobj.  A `kvsdir_t` obtained with `kvs_get_dir()` does not have this reference and thus tracks the live KVS namespace.\r\n\r\nThe requirement that `kvs_get_dirat()` be used in order to establish a `kvsdir_t` tied to a treeobj seems sort of wrong.  Should this be the default behavior for `kvs_get_dir()`?  I thought so but I don't think this is consistent with the way `kvsdir_t` is used in the lua bindings, wreck, and perhaps elsewhere.  Any thoughts especially from @grondo?\r\n\r\n`flux-kvs` `getat` and `dirat` subcommands are added, as are some tests.  There's a bit of gratuitous kvs cleanup and testing thrown in.\r\n\r\nI'm still tracking down one bit of behavior that I don't understand, but thought I'd post this early to get any feedback."},"comment":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/comments/249297949","html_url":"https://github.com/flux-framework/flux-core/pull/820#issuecomment-249297949","issue_url":"https://api.github.com/repos/flux-framework/flux-core/issues/820","id":249297949,"user":{"login":"grondo","id":741970,"avatar_url":"https://avatars.githubusercontent.com/u/741970?v=3","gravatar_id":"","url":"https://api.github.com/users/grondo","html_url":"https://github.com/grondo","followers_url":"https://api.github.com/users/grondo/followers","following_url":"https://api.github.com/users/grondo/following{/other_user}","gists_url":"https://api.github.com/users/grondo/gists{/gist_id}","starred_url":"https://api.github.com/users/grondo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grondo/subscriptions","organizations_url":"https://api.github.com/users/grondo/orgs","repos_url":"https://api.github.com/users/grondo/repos","events_url":"https://api.github.com/users/grondo/events{/privacy}","received_events_url":"https://api.github.com/users/grondo/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T20:44:57Z","updated_at":"2016-09-23T20:44:57Z","body":"And actually, now that I think about it, in places where Lua script is reading from kvs directories, the functionality you are proposing is what we'd want anyway. I'm not sure if there is a spot where we write to KVS using a kvsdir and expect to read it back (but I have to check)\r\n\r\nWhat will happen after proposed changes if you get a `kvsdir_t` with `kvs_get_dirat` and then do a `kvsdir_put` using that kvsdir?"}}
{"actor":{"display_login":"grondo"}}