{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/57344421","id":57344421,"diff_hunk":"@@ -105,19 +105,28 @@ void PoolWatcher::refresh_images(bool reschedule)\n       continue;\n     }\n \n-    // only format 2 images can be mirrored, so only check the format\n-    // 2 rbd_directory structure\n-    std::vector<std::string> image_ids;\n-    r = mirror_image_list(&ioctx, &image_ids);\n-    if (r < 0) {\n-      derr << \"error listing mirrored images in pool \" << pool_name << \": \"\n-           << cpp_strerror(r) << dendl;\n-      continue;\n-    }\n+    std::set<std::string> image_ids;\n+    std::string last_read = \"\";\n+    int max_read = 1024;\n+    do {\n+      std::map<std::string, std::string> mirror_images;\n+      r =  mirror_image_list(&ioctx, last_read, max_read, &mirror_images);\n+      if (r < 0) {\n+        derr << \"error listing mirrored image directory: \"\n+             << cpp_strerror(r) << dendl;\n+        continue;\n+      }\n+      for (auto it = mirror_images.begin(); it != mirror_images.end(); ++it) {\n+        image_ids.insert(it->first);\n+      }\n+      if (!mirror_images.empty()) {\n+        last_read = mirror_images.rbegin()->first;\n+      }\n+      r = mirror_images.size();","path":"src/tools/rbd_mirror/PoolWatcher.cc","position":30,"original_position":30,"commit_id":"206cf5a56dd23d43fc098efea2346a7ddff33eaf","original_commit_id":"206cf5a56dd23d43fc098efea2346a7ddff33eaf","user":{"login":"jdurgin","id":1022584,"avatar_url":"https://avatars.githubusercontent.com/u/1022584?v=3","gravatar_id":"","url":"https://api.github.com/users/jdurgin","html_url":"https://github.com/jdurgin","followers_url":"https://api.github.com/users/jdurgin/followers","following_url":"https://api.github.com/users/jdurgin/following{/other_user}","gists_url":"https://api.github.com/users/jdurgin/gists{/gist_id}","starred_url":"https://api.github.com/users/jdurgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdurgin/subscriptions","organizations_url":"https://api.github.com/users/jdurgin/orgs","repos_url":"https://api.github.com/users/jdurgin/repos","events_url":"https://api.github.com/users/jdurgin/events{/privacy}","received_events_url":"https://api.github.com/users/jdurgin/received_events","type":"User","site_admin":false},"body":"nvm, misread","created_at":"2016-03-24T16:26:57Z","updated_at":"2016-03-24T16:26:57Z","html_url":"https://github.com/ceph/ceph/pull/8297#discussion_r57344421","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/8297","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/57344421"},"html":{"href":"https://github.com/ceph/ceph/pull/8297#discussion_r57344421"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8297"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/8297","id":64030508,"html_url":"https://github.com/ceph/ceph/pull/8297","diff_url":"https://github.com/ceph/ceph/pull/8297.diff","patch_url":"https://github.com/ceph/ceph/pull/8297.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/8297","number":8297,"state":"open","locked":false,"title":"cls_rbd: mirror_image_list should return global image id","user":{"login":"dillaman","id":4739042,"avatar_url":"https://avatars.githubusercontent.com/u/4739042?v=3","gravatar_id":"","url":"https://api.github.com/users/dillaman","html_url":"https://github.com/dillaman","followers_url":"https://api.github.com/users/dillaman/followers","following_url":"https://api.github.com/users/dillaman/following{/other_user}","gists_url":"https://api.github.com/users/dillaman/gists{/gist_id}","starred_url":"https://api.github.com/users/dillaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dillaman/subscriptions","organizations_url":"https://api.github.com/users/dillaman/orgs","repos_url":"https://api.github.com/users/dillaman/repos","events_url":"https://api.github.com/users/dillaman/events{/privacy}","received_events_url":"https://api.github.com/users/dillaman/received_events","type":"User","site_admin":false},"body":"The global image id is needed to crosslink images when an image is\r\nreplicated between multiple clusters.\r\n\r\nSigned-off-by: Jason Dillaman <dillaman@redhat.com>","created_at":"2016-03-24T13:03:29Z","updated_at":"2016-03-24T16:26:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b17e25e80fcd130545f75e8f0205f646f2dd77f","assignee":null,"milestone":{"url":"https://api.github.com/repos/ceph/ceph/milestones/8","html_url":"https://github.com/ceph/ceph/milestones/jewel","labels_url":"https://api.github.com/repos/ceph/ceph/milestones/8/labels","id":1403256,"number":8,"title":"jewel","description":"","creator":{"login":"dillaman","id":4739042,"avatar_url":"https://avatars.githubusercontent.com/u/4739042?v=3","gravatar_id":"","url":"https://api.github.com/users/dillaman","html_url":"https://github.com/dillaman","followers_url":"https://api.github.com/users/dillaman/followers","following_url":"https://api.github.com/users/dillaman/following{/other_user}","gists_url":"https://api.github.com/users/dillaman/gists{/gist_id}","starred_url":"https://api.github.com/users/dillaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dillaman/subscriptions","organizations_url":"https://api.github.com/users/dillaman/orgs","repos_url":"https://api.github.com/users/dillaman/repos","events_url":"https://api.github.com/users/dillaman/events{/privacy}","received_events_url":"https://api.github.com/users/dillaman/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":245,"state":"open","created_at":"2015-11-09T22:29:48Z","updated_at":"2016-03-24T16:19:48Z","due_on":"2016-03-20T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/8297/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/8297/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/8297/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/206cf5a56dd23d43fc098efea2346a7ddff33eaf","head":{"label":"dillaman:wip-cls-rbd-mirror-image-list","ref":"wip-cls-rbd-mirror-image-list","sha":"206cf5a56dd23d43fc098efea2346a7ddff33eaf","user":{"login":"dillaman","id":4739042,"avatar_url":"https://avatars.githubusercontent.com/u/4739042?v=3","gravatar_id":"","url":"https://api.github.com/users/dillaman","html_url":"https://github.com/dillaman","followers_url":"https://api.github.com/users/dillaman/followers","following_url":"https://api.github.com/users/dillaman/following{/other_user}","gists_url":"https://api.github.com/users/dillaman/gists{/gist_id}","starred_url":"https://api.github.com/users/dillaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dillaman/subscriptions","organizations_url":"https://api.github.com/users/dillaman/orgs","repos_url":"https://api.github.com/users/dillaman/repos","events_url":"https://api.github.com/users/dillaman/events{/privacy}","received_events_url":"https://api.github.com/users/dillaman/received_events","type":"User","site_admin":false},"repo":{"id":22644788,"name":"ceph","full_name":"dillaman/ceph","owner":{"login":"dillaman","id":4739042,"avatar_url":"https://avatars.githubusercontent.com/u/4739042?v=3","gravatar_id":"","url":"https://api.github.com/users/dillaman","html_url":"https://github.com/dillaman","followers_url":"https://api.github.com/users/dillaman/followers","following_url":"https://api.github.com/users/dillaman/following{/other_user}","gists_url":"https://api.github.com/users/dillaman/gists{/gist_id}","starred_url":"https://api.github.com/users/dillaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dillaman/subscriptions","organizations_url":"https://api.github.com/users/dillaman/orgs","repos_url":"https://api.github.com/users/dillaman/repos","events_url":"https://api.github.com/users/dillaman/events{/privacy}","received_events_url":"https://api.github.com/users/dillaman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dillaman/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/dillaman/ceph","forks_url":"https://api.github.com/repos/dillaman/ceph/forks","keys_url":"https://api.github.com/repos/dillaman/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dillaman/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dillaman/ceph/teams","hooks_url":"https://api.github.com/repos/dillaman/ceph/hooks","issue_events_url":"https://api.github.com/repos/dillaman/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/dillaman/ceph/events","assignees_url":"https://api.github.com/repos/dillaman/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/dillaman/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/dillaman/ceph/tags","blobs_url":"https://api.github.com/repos/dillaman/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dillaman/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dillaman/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/dillaman/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dillaman/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/dillaman/ceph/languages","stargazers_url":"https://api.github.com/repos/dillaman/ceph/stargazers","contributors_url":"https://api.github.com/repos/dillaman/ceph/contributors","subscribers_url":"https://api.github.com/repos/dillaman/ceph/subscribers","subscription_url":"https://api.github.com/repos/dillaman/ceph/subscription","commits_url":"https://api.github.com/repos/dillaman/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/dillaman/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/dillaman/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/dillaman/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/dillaman/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/dillaman/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dillaman/ceph/merges","archive_url":"https://api.github.com/repos/dillaman/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dillaman/ceph/downloads","issues_url":"https://api.github.com/repos/dillaman/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/dillaman/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/dillaman/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/dillaman/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dillaman/ceph/labels{/name}","releases_url":"https://api.github.com/repos/dillaman/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/dillaman/ceph/deployments","created_at":"2014-08-05T13:37:10Z","updated_at":"2014-10-06T18:20:50Z","pushed_at":"2016-03-24T15:29:18Z","git_url":"git://github.com/dillaman/ceph.git","ssh_url":"git@github.com:dillaman/ceph.git","clone_url":"https://github.com/dillaman/ceph.git","svn_url":"https://github.com/dillaman/ceph","homepage":"http://ceph.com","size":158998,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"518c238fbf66a851f3bfcd40b56fb381c259d5d9","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-03-24T13:57:26Z","pushed_at":"2016-03-24T16:26:25Z","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":209027,"stargazers_count":1982,"watchers_count":1982,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1205,"mirror_url":null,"open_issues_count":290,"forks":1205,"open_issues":290,"watchers":1982,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8297"},"html":{"href":"https://github.com/ceph/ceph/pull/8297"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/8297"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/8297/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8297/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8297/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/206cf5a56dd23d43fc098efea2346a7ddff33eaf"}}}}