{"action":"created","issue":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/471","labels_url":"https://api.github.com/repos/flux-framework/flux-core/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/flux-framework/flux-core/issues/471/comments","events_url":"https://api.github.com/repos/flux-framework/flux-core/issues/471/events","html_url":"https://github.com/flux-framework/flux-core/pull/471","id":115153799,"number":471,"title":"implement kvs backing store using sophia","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,"milestone":null,"comments":20,"created_at":"2015-11-04T21:37:14Z","updated_at":"2015-11-18T22:04:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flux-framework/flux-core/pulls/471","html_url":"https://github.com/flux-framework/flux-core/pull/471","diff_url":"https://github.com/flux-framework/flux-core/pull/471.diff","patch_url":"https://github.com/flux-framework/flux-core/pull/471.patch"},"body":"This PR Is not complete but I thought it should get some early high level review concurrently with progress refining it.\r\n\r\nThe [sophia](http://sphia.org/) embedable database engine is imported into `libflux-internal`, then a new module `cas` (content addressable store) is added which stores arbitrary blobs persistently.  The protocol is simple:  send a blob, get back an SHA1; send an SHA1, get back a blob.  blobs and SHA1's are sent using raw message payloads to avoid the overhead of json encoding.  Files are created in the same temporary directory as the ipc sockets and persist for the lifetime of the session only.  This module is then loaded automatically on rank 0 (only).\r\n\r\nTo test the cas service, two new operations were added to `flux-kvs`:  putobj and getobj.  These behave similar to the git-hash and get-cat-file utilities, respectively:\r\n```\r\n$ echo hello | ./flux kvs putobj\r\n5f273d69af9e02668217f42bec007fe2492f52f8\r\n$ ./flux kvs getobj 5f273d69af9e02668217f42bec007fe2492f52f8\r\nhello\r\n```\r\n\r\nThe KVS was then modified so that the rank 0 object cache is expired temporally like other ranks, and the CAS is integrated as the \"upstream\" cache of rank 0.\r\n\r\nThis should get the memory utilization of the KVS on rank 0 under control, at the expense of some disk usage (which if it is a ramdisk, well...), and increased commit latency.\r\n\r\nI'm not sure if I'm using sophia correctly, particularly with regard to error handling and memory management, as there is not much in the way of examples online.  What I have seems to work at least superficially.  I have enabled lz4 compression of objects.  Some sophia spelunking and stress testing is required to understand how it should be used to best advantage.\r\n\r\nThere is definitely some work needed to clean things up, factor out duplicated code, and adding tests, but what's here seems to work with make check and manual poking."},"comment":{"url":"https://api.github.com/repos/flux-framework/flux-core/issues/comments/157879402","html_url":"https://github.com/flux-framework/flux-core/pull/471#issuecomment-157879402","issue_url":"https://api.github.com/repos/flux-framework/flux-core/issues/471","id":157879402,"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},"created_at":"2015-11-18T22:04:44Z","updated_at":"2015-11-18T22:04:44Z","body":"The current code uses the backing store synchronously but it would actually be reasonable IMHO to use it asynchronously, e.g. return to the KVS caller before object is on disk, as long as we keep the dirty bit on the cache entry until it is."}}