{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/64043642","id":64043642,"diff_hunk":"@@ -224,6 +224,87 @@ int expire_tags(cls_method_context_t hctx, const std::string *skip_client_id) {\n   return 0;\n }\n \n+int get_client_list_range(cls_method_context_t hctx,\n+                          std::set<cls::journal::Client> *clients,\n+                          std::string start_after, uint64_t max_return) {\n+  std::string last_read;\n+  if (!start_after.empty()) {\n+    last_read = key_from_client_id(start_after);\n+  }\n+\n+  std::map<std::string, bufferlist> vals;\n+  int r = cls_cxx_map_get_vals(hctx, last_read, HEADER_KEY_CLIENT_PREFIX,\n+                               max_return, &vals);\n+  if (r < 0) {\n+    CLS_ERR(\"failed to retrieve omap values: %s\", cpp_strerror(r).c_str());\n+    return r;\n+  }\n+\n+  for (std::map<std::string, bufferlist>::iterator it = vals.begin();\n+       it != vals.end(); ++it) {\n+    try {\n+      bufferlist::iterator iter = it->second.begin();\n+\n+      cls::journal::Client client;\n+      ::decode(client, iter);\n+      clients->insert(client);\n+    } catch (const buffer::error &err) {\n+      CLS_ERR(\"could not decode client '%s': %s\", it->first.c_str(),\n+              err.what());\n+      return -EIO;\n+    }\n+  }\n+\n+  return 0;\n+}\n+\n+int find_min_commit_position(cls_method_context_t hctx,\n+                             cls::journal::ObjectSetPosition *minset) {\n+  int r;\n+  bool valid = false;\n+  std::string start_after = \"\";\n+  uint64_t tag_tid = 0, entry_tid = 0;\n+\n+  while (true) {\n+    std::set<cls::journal::Client> batch;\n+    cls::journal::ObjectPosition first;\n+    cls::journal::ObjectSetPosition object_set_position;\n+    uint64_t max_return = cls::journal::JOURNAL_MAX_RETURN;","path":"src/cls/journal/cls_journal.cc","position":49,"original_position":49,"commit_id":"0a454b947a69849e0e8666e742b3647c98c4e4b1","original_commit_id":"0a454b947a69849e0e8666e742b3647c98c4e4b1","user":{"login":"rjfd","id":17119885,"avatar_url":"https://avatars.githubusercontent.com/u/17119885?v=3","gravatar_id":"","url":"https://api.github.com/users/rjfd","html_url":"https://github.com/rjfd","followers_url":"https://api.github.com/users/rjfd/followers","following_url":"https://api.github.com/users/rjfd/following{/other_user}","gists_url":"https://api.github.com/users/rjfd/gists{/gist_id}","starred_url":"https://api.github.com/users/rjfd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjfd/subscriptions","organizations_url":"https://api.github.com/users/rjfd/orgs","repos_url":"https://api.github.com/users/rjfd/repos","events_url":"https://api.github.com/users/rjfd/events{/privacy}","received_events_url":"https://api.github.com/users/rjfd/received_events","type":"User","site_admin":false},"body":"Why do you need the `max_return` variable, it will always have the same value. Why not use the constant `cls::journal::JOURNAL_MAX_RETURN` directly?","created_at":"2016-05-20T13:49:14Z","updated_at":"2016-05-20T13:49:14Z","html_url":"https://github.com/ceph/ceph/pull/9179#discussion_r64043642","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/9179","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/64043642"},"html":{"href":"https://github.com/ceph/ceph/pull/9179#discussion_r64043642"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9179"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/9179","id":70556214,"html_url":"https://github.com/ceph/ceph/pull/9179","diff_url":"https://github.com/ceph/ceph/pull/9179.diff","patch_url":"https://github.com/ceph/ceph/pull/9179.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/9179","number":9179,"state":"open","locked":false,"title":"cls_journal: initialize empty commit position upon client register","user":{"login":"vshankar","id":105507,"avatar_url":"https://avatars.githubusercontent.com/u/105507?v=3","gravatar_id":"","url":"https://api.github.com/users/vshankar","html_url":"https://github.com/vshankar","followers_url":"https://api.github.com/users/vshankar/followers","following_url":"https://api.github.com/users/vshankar/following{/other_user}","gists_url":"https://api.github.com/users/vshankar/gists{/gist_id}","starred_url":"https://api.github.com/users/vshankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vshankar/subscriptions","organizations_url":"https://api.github.com/users/vshankar/orgs","repos_url":"https://api.github.com/users/vshankar/repos","events_url":"https://api.github.com/users/vshankar/events{/privacy}","received_events_url":"https://api.github.com/users/vshankar/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-18T16:08:27Z","updated_at":"2016-05-20T13:49:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a240c6e86e8863ba12680a91d81345ffa2245d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/9179/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/9179/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/9179/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/0a454b947a69849e0e8666e742b3647c98c4e4b1","head":{"label":"vshankar:rbd-min-commit-position","ref":"rbd-min-commit-position","sha":"0a454b947a69849e0e8666e742b3647c98c4e4b1","user":{"login":"vshankar","id":105507,"avatar_url":"https://avatars.githubusercontent.com/u/105507?v=3","gravatar_id":"","url":"https://api.github.com/users/vshankar","html_url":"https://github.com/vshankar","followers_url":"https://api.github.com/users/vshankar/followers","following_url":"https://api.github.com/users/vshankar/following{/other_user}","gists_url":"https://api.github.com/users/vshankar/gists{/gist_id}","starred_url":"https://api.github.com/users/vshankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vshankar/subscriptions","organizations_url":"https://api.github.com/users/vshankar/orgs","repos_url":"https://api.github.com/users/vshankar/repos","events_url":"https://api.github.com/users/vshankar/events{/privacy}","received_events_url":"https://api.github.com/users/vshankar/received_events","type":"User","site_admin":false},"repo":{"id":20640613,"name":"ceph","full_name":"vshankar/ceph","owner":{"login":"vshankar","id":105507,"avatar_url":"https://avatars.githubusercontent.com/u/105507?v=3","gravatar_id":"","url":"https://api.github.com/users/vshankar","html_url":"https://github.com/vshankar","followers_url":"https://api.github.com/users/vshankar/followers","following_url":"https://api.github.com/users/vshankar/following{/other_user}","gists_url":"https://api.github.com/users/vshankar/gists{/gist_id}","starred_url":"https://api.github.com/users/vshankar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vshankar/subscriptions","organizations_url":"https://api.github.com/users/vshankar/orgs","repos_url":"https://api.github.com/users/vshankar/repos","events_url":"https://api.github.com/users/vshankar/events{/privacy}","received_events_url":"https://api.github.com/users/vshankar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vshankar/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/vshankar/ceph","forks_url":"https://api.github.com/repos/vshankar/ceph/forks","keys_url":"https://api.github.com/repos/vshankar/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vshankar/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vshankar/ceph/teams","hooks_url":"https://api.github.com/repos/vshankar/ceph/hooks","issue_events_url":"https://api.github.com/repos/vshankar/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/vshankar/ceph/events","assignees_url":"https://api.github.com/repos/vshankar/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/vshankar/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/vshankar/ceph/tags","blobs_url":"https://api.github.com/repos/vshankar/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vshankar/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vshankar/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/vshankar/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vshankar/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/vshankar/ceph/languages","stargazers_url":"https://api.github.com/repos/vshankar/ceph/stargazers","contributors_url":"https://api.github.com/repos/vshankar/ceph/contributors","subscribers_url":"https://api.github.com/repos/vshankar/ceph/subscribers","subscription_url":"https://api.github.com/repos/vshankar/ceph/subscription","commits_url":"https://api.github.com/repos/vshankar/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/vshankar/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/vshankar/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/vshankar/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/vshankar/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/vshankar/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vshankar/ceph/merges","archive_url":"https://api.github.com/repos/vshankar/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vshankar/ceph/downloads","issues_url":"https://api.github.com/repos/vshankar/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/vshankar/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/vshankar/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/vshankar/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vshankar/ceph/labels{/name}","releases_url":"https://api.github.com/repos/vshankar/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/vshankar/ceph/deployments","created_at":"2014-06-09T09:10:59Z","updated_at":"2016-01-11T06:27:56Z","pushed_at":"2016-05-20T13:32:52Z","git_url":"git://github.com/vshankar/ceph.git","ssh_url":"git@github.com:vshankar/ceph.git","clone_url":"https://github.com/vshankar/ceph.git","svn_url":"https://github.com/vshankar/ceph","homepage":"http://ceph.com","size":147593,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"27a9d4c2d71e64986c6f9ea929d79d733c098f2b","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","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,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","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":"2016-05-20T12:41:45Z","pushed_at":"2016-05-20T13:46:30Z","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":213453,"stargazers_count":2160,"watchers_count":2160,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1277,"mirror_url":null,"open_issues_count":334,"forks":1277,"open_issues":334,"watchers":2160,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9179"},"html":{"href":"https://github.com/ceph/ceph/pull/9179"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/9179"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/9179/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9179/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9179/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/0a454b947a69849e0e8666e742b3647c98c4e4b1"}}}}
{"actor":{"display_login":"rjfd"}}