{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/205246565","pull_request_review_id":140480441,"id":205246565,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTI0NjU2NQ==","diff_hunk":"@@ -0,0 +1,125 @@\n+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-\n+\n+#pragma once\n+\n+#include <seastar/core/reactor.hh>\n+#include <seastar/core/sharded.hh>\n+#include \"common/config.h\"\n+#include \"common/config_obs.h\"\n+#include \"common/config_obs_mgr.h\"\n+\n+namespace ceph::common {\n+\n+// a facade for managing config. each shard has its own copy of ConfigProxy.\n+//\n+// In seastar-osd, there could be multiple instances of @c ConfigValues in a\n+// single process, as we are using a variant of read-copy-update mechinary to\n+// update the settings at runtime.\n+class ConfigProxy : public seastar::peering_sharded_service<ConfigProxy>\n+{\n+  using LocalConfigValues = seastar::lw_shared_ptr<ConfigValues>;\n+  seastar::foreign_ptr<LocalConfigValues> values;\n+\n+  md_config_t* remote_config = nullptr;\n+  std::unique_ptr<md_config_t> local_config;\n+\n+  using ConfigObserver = ceph::internal::md_config_obs_impl<ConfigProxy>;\n+  ObserverMgr<ConfigObserver> obs_mgr;\n+\n+  const md_config_t& get_config() const {\n+    return remote_config ? *remote_config : * local_config;\n+  }\n+  md_config_t& get_config() {\n+    return remote_config ? *remote_config : * local_config;\n+  }\n+\n+  // apply changes to all shards\n+  // @param func a functor which accepts @c \"ConfigValues&\", and returns\n+  //             a boolean indicating if the values is changed or not\n+  template<typename Func>\n+  seastar::future<> do_change(Func&& func) {\n+    auto new_values = seastar::make_lw_shared(*values);\n+    func(*new_values);","path":"src/crimson/common/config_proxy.h","position":42,"original_position":42,"commit_id":"4f34c56e7c9e576d43882fab256e12e013f7c8ff","original_commit_id":"4f34c56e7c9e576d43882fab256e12e013f7c8ff","user":{"login":"cbodley","id":1928002,"node_id":"MDQ6VXNlcjE5MjgwMDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1928002?v=4","gravatar_id":"","url":"https://api.github.com/users/cbodley","html_url":"https://github.com/cbodley","followers_url":"https://api.github.com/users/cbodley/followers","following_url":"https://api.github.com/users/cbodley/following{/other_user}","gists_url":"https://api.github.com/users/cbodley/gists{/gist_id}","starred_url":"https://api.github.com/users/cbodley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbodley/subscriptions","organizations_url":"https://api.github.com/users/cbodley/orgs","repos_url":"https://api.github.com/users/cbodley/repos","events_url":"https://api.github.com/users/cbodley/events{/privacy}","received_events_url":"https://api.github.com/users/cbodley/received_events","type":"User","site_admin":false},"body":"can we check the return value of `func()` for false here to skip the rest of the function if nothing changed?","created_at":"2018-07-25T20:12:21Z","updated_at":"2018-07-25T20:40:34Z","html_url":"https://github.com/ceph/ceph/pull/23074#discussion_r205246565","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/23074","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/205246565"},"html":{"href":"https://github.com/ceph/ceph/pull/23074#discussion_r205246565"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23074"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/23074","id":201667858,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNjY3ODU4","html_url":"https://github.com/ceph/ceph/pull/23074","diff_url":"https://github.com/ceph/ceph/pull/23074.diff","patch_url":"https://github.com/ceph/ceph/pull/23074.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/23074","number":23074,"state":"closed","locked":false,"title":"common/config: add ConfigProxy for crimson","user":{"login":"tchaikov","id":59071,"node_id":"MDQ6VXNlcjU5MDcx","avatar_url":"https://avatars2.githubusercontent.com/u/59071?v=4","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-16T15:06:47Z","updated_at":"2018-07-25T20:40:34Z","closed_at":"2018-07-25T17:02:12Z","merged_at":"2018-07-25T17:02:12Z","merge_commit_sha":"a8b39ccc2c1845c99b10f26ed320156fc9b338c8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gregsfortytwo","id":908479,"node_id":"MDQ6VXNlcjkwODQ3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/908479?v=4","gravatar_id":"","url":"https://api.github.com/users/gregsfortytwo","html_url":"https://github.com/gregsfortytwo","followers_url":"https://api.github.com/users/gregsfortytwo/followers","following_url":"https://api.github.com/users/gregsfortytwo/following{/other_user}","gists_url":"https://api.github.com/users/gregsfortytwo/gists{/gist_id}","starred_url":"https://api.github.com/users/gregsfortytwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregsfortytwo/subscriptions","organizations_url":"https://api.github.com/users/gregsfortytwo/orgs","repos_url":"https://api.github.com/users/gregsfortytwo/repos","events_url":"https://api.github.com/users/gregsfortytwo/events{/privacy}","received_events_url":"https://api.github.com/users/gregsfortytwo/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":199292951,"node_id":"MDU6TGFiZWwxOTkyOTI5NTE=","url":"https://api.github.com/repos/ceph/ceph/labels/common","name":"common","color":"006b75","default":false},{"id":959692411,"node_id":"MDU6TGFiZWw5NTk2OTI0MTE=","url":"https://api.github.com/repos/ceph/ceph/labels/crimson","name":"crimson","color":"B80f0a","default":false},{"id":148431321,"node_id":"MDU6TGFiZWwxNDg0MzEzMjE=","url":"https://api.github.com/repos/ceph/ceph/labels/needs-qa","name":"needs-qa","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/23074/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/23074/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/23074/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/4f34c56e7c9e576d43882fab256e12e013f7c8ff","head":{"label":"tchaikov:wip-seastar-config","ref":"wip-seastar-config","sha":"4f34c56e7c9e576d43882fab256e12e013f7c8ff","user":{"login":"tchaikov","id":59071,"node_id":"MDQ6VXNlcjU5MDcx","avatar_url":"https://avatars2.githubusercontent.com/u/59071?v=4","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"repo":{"id":26736928,"node_id":"MDEwOlJlcG9zaXRvcnkyNjczNjkyOA==","name":"ceph","full_name":"tchaikov/ceph","owner":{"login":"tchaikov","id":59071,"node_id":"MDQ6VXNlcjU5MDcx","avatar_url":"https://avatars2.githubusercontent.com/u/59071?v=4","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tchaikov/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/tchaikov/ceph","forks_url":"https://api.github.com/repos/tchaikov/ceph/forks","keys_url":"https://api.github.com/repos/tchaikov/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tchaikov/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tchaikov/ceph/teams","hooks_url":"https://api.github.com/repos/tchaikov/ceph/hooks","issue_events_url":"https://api.github.com/repos/tchaikov/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/tchaikov/ceph/events","assignees_url":"https://api.github.com/repos/tchaikov/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/tchaikov/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/tchaikov/ceph/tags","blobs_url":"https://api.github.com/repos/tchaikov/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tchaikov/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tchaikov/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/tchaikov/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tchaikov/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/tchaikov/ceph/languages","stargazers_url":"https://api.github.com/repos/tchaikov/ceph/stargazers","contributors_url":"https://api.github.com/repos/tchaikov/ceph/contributors","subscribers_url":"https://api.github.com/repos/tchaikov/ceph/subscribers","subscription_url":"https://api.github.com/repos/tchaikov/ceph/subscription","commits_url":"https://api.github.com/repos/tchaikov/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/tchaikov/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/tchaikov/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/tchaikov/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/tchaikov/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/tchaikov/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tchaikov/ceph/merges","archive_url":"https://api.github.com/repos/tchaikov/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tchaikov/ceph/downloads","issues_url":"https://api.github.com/repos/tchaikov/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/tchaikov/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/tchaikov/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/tchaikov/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tchaikov/ceph/labels{/name}","releases_url":"https://api.github.com/repos/tchaikov/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/tchaikov/ceph/deployments","created_at":"2014-11-17T02:40:21Z","updated_at":"2017-03-03T08:58:24Z","pushed_at":"2018-07-25T17:02:17Z","git_url":"git://github.com/tchaikov/ceph.git","ssh_url":"git@github.com:tchaikov/ceph.git","clone_url":"https://github.com/tchaikov/ceph.git","svn_url":"https://github.com/tchaikov/ceph","homepage":"http://ceph.com","size":303609,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"b8f079a653c4d86357b759e54c3a26b7f691e3b5","user":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"node_id":"MDEwOlJlcG9zaXRvcnkyMzEwNDk1","name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2018-07-25T19:38:28Z","pushed_at":"2018-07-25T20:21:02Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":300032,"stargazers_count":4851,"watchers_count":4851,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2545,"mirror_url":null,"archived":false,"open_issues_count":739,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2545,"open_issues":739,"watchers":4851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23074"},"html":{"href":"https://github.com/ceph/ceph/pull/23074"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/23074"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/23074/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23074/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23074/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/4f34c56e7c9e576d43882fab256e12e013f7c8ff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cbodley"}}