{"action":"created","issue":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/1622","repository_url":"https://api.github.com/repos/flux-framework/flux-core","labels_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1622/labels{/name}","comments_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1622/comments","events_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1622/events","html_url":"https://github.com/flux-framework/flux-core/pull/1622","id":351006204,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NzEwOTc0","number":1622,"title":"kvs: add kvs-watch module","user":{"login":"garlick","id":169947,"node_id":"MDQ6VXNlcjE2OTk0Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/169947?v=4","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":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-08-15T23:46:52Z","updated_at":"2018-08-17T16:59:05Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/flux-framework/flux-core/pulls/1622","html_url":"https://github.com/flux-framework/flux-core/pull/1622","diff_url":"https://github.com/flux-framework/flux-core/pull/1622.diff","patch_url":"https://github.com/flux-framework/flux-core/pull/1622.patch"},"body":"(N.B. just realized I didn't finish reworking commit messages - please hold off on any detailed review)\r\n\r\nThis PR is a precursor to reworking the KVS watch mechanism.  It adds a new module `kvs-watch` that currently only supports \"watching\" the root hash of a namespace. (I thought this was complicated enough for a PR, and the generic watch could wait for another PR).\r\n\r\nThis PR adds the following API:\r\n```c\r\n/* Request the current KVS root hash for namespace 'ns'.\r\n * If flags = FLUX_KVS_WATCH, a response is sent each time the root\r\n * hash changes.  In that case, the user must call flux_future_reset()\r\n * after consuming the response to re-arm the future for the next response.\r\n */\r\nflux_future_t *flux_kvs_getroot (flux_t *h, const char *ns, int flags);\r\n\r\n/* Decode KVS root hash response.\r\n *\r\n * treeobj - get the hash as an RFC 11 \"dirref\" object.\r\n * blobref - get the raw hash as a n RFC 10 \"blobref\".\r\n * sequence - get the commit sequence number\r\n * owner - get the userid of the namespace owner\r\n */\r\nint flux_kvs_getroot_get_treeobj (flux_future_t *f, const char **treeobj);\r\nint flux_kvs_getroot_get_blobref (flux_future_t *f, const char **blobref);\r\nint flux_kvs_getroot_get_sequence (flux_future_t *f, int *seq);\r\nint flux_kvs_getroot_get_owner (flux_future_t *f, uint32_t *owner);\r\n\r\n/* Cancel a FLUX_KVS_WATCH \"stream\".\r\n * Once the cancel request is processed, an ENODATA error response is sent,\r\n * thus the user should continue to reset and consume responses until an\r\n * error occurs, after which it is safe to destroy the future.\r\n */\r\nint flux_kvs_getroot_cancel (flux_future_t *f);\r\n```\r\n\r\nMy plan for regular watch API is to simply allow the FLUX_KVS_WATCH flag to be passed to `flux_kvs_lookup()`.\r\n\r\nI added a new `flux kvs getroot` subcommand, a man page, and a sharness test.\r\n\r\nAlso, since `flux_kvs_get_version()` is a synchronous RPC interface that accomplishes the same thing as `flux_kvs_getroot()` + `flux_kvs_getroot_get_sequence()`, and had no users except tests, I went ahead and eliminated the former and also the `flux kvs version` subcommand, and updated tests accordingly."},"comment":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/comments/413927293","html_url":"https://github.com/flux-framework/flux-core/pull/1622#issuecomment-413927293","issue_url":"https://api.github.com/repos/flux-framework/flux-core/issues/1622","id":413927293,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzkyNzI5Mw==","user":{"login":"chu11","id":274859,"node_id":"MDQ6VXNlcjI3NDg1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/274859?v=4","gravatar_id":"","url":"https://api.github.com/users/chu11","html_url":"https://github.com/chu11","followers_url":"https://api.github.com/users/chu11/followers","following_url":"https://api.github.com/users/chu11/following{/other_user}","gists_url":"https://api.github.com/users/chu11/gists{/gist_id}","starred_url":"https://api.github.com/users/chu11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chu11/subscriptions","organizations_url":"https://api.github.com/users/chu11/orgs","repos_url":"https://api.github.com/users/chu11/repos","events_url":"https://api.github.com/users/chu11/events{/privacy}","received_events_url":"https://api.github.com/users/chu11/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T16:59:05Z","updated_at":"2018-08-17T16:59:05Z","author_association":"CONTRIBUTOR","body":"> This PR lays the groundwork for watching keys, but the actual code for watching keys will come in another PR. \r\n\r\nAhh ok.  Perhaps I was thinking too far out, should wait until the implementation is done."}}
{"actor":{"display_login":"chu11"}}