{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/64195287","id":64195287,"diff_hunk":"@@ -524,6 +521,156 @@ int rgw_remove_bucket(RGWRados *store, rgw_bucket& bucket, bool delete_children)\n   return ret;\n }\n \n+static int aio_wait(librados::AioCompletion *handle)\n+{\n+  librados::AioCompletion *c = (librados::AioCompletion *)handle;\n+  c->wait_for_complete();\n+  int ret = c->get_return_value();\n+  c->release();\n+  return ret;\n+}\n+\n+static int drain_handles(list<librados::AioCompletion *>& pending)\n+{\n+  int ret = 0;\n+  while (!pending.empty()) {\n+    librados::AioCompletion *handle = pending.front();\n+    pending.pop_front();\n+    int r = aio_wait(handle);\n+    if (r < 0) {\n+      ret = r;\n+    }\n+  }\n+  return ret;\n+}\n+\n+int rgw_remove_bucket_bypass_gc(RGWRados *store, rgw_bucket& bucket, int concurrent_max)\n+{\n+  int ret;\n+  map<RGWObjCategory, RGWStorageStats> stats;\n+  std::vector<RGWObjEnt> objs;\n+  map<string, bool> common_prefixes;\n+  RGWBucketInfo info;\n+  RGWObjectCtx obj_ctx(store);\n+\n+  string bucket_ver, master_ver;\n+\n+  ret = store->get_bucket_stats(bucket, RGW_NO_SHARD, &bucket_ver, &master_ver, stats, NULL);\n+  if (ret < 0)\n+    return ret;\n+\n+  ret = store->get_bucket_info(obj_ctx, bucket.tenant, bucket.name, info, NULL);\n+  if (ret < 0)\n+    return ret;\n+\n+\n+  RGWRados::Bucket target(store, info);\n+  RGWRados::Bucket::List list_op(&target);\n+\n+  list_op.params.list_versions = true;\n+\n+  std::list<librados::AioCompletion*> handles;\n+\n+  int max = 1000;\n+  int max_aio = concurrent_max;\n+  ret = list_op.list_objects(max, &objs, &common_prefixes, NULL);\n+  if (ret < 0)\n+    return ret;\n+\n+  while (!objs.empty()) {\n+    std::vector<RGWObjEnt>::iterator it = objs.begin();\n+    for (it = objs.begin(); it != objs.end(); ++it) {\n+      RGWObjState *astate = NULL;\n+      rgw_obj obj(bucket, (*it).key.name);","path":"src/rgw/rgw_bucket.cc","position":null,"original_position":91,"commit_id":"3b1a7dee5fb53b854bbe57f4452ac63d0562553b","original_commit_id":"bea338bf63130240d7b30b1ac24f8dd04f80f619","user":{"login":"prallabh","id":7311132,"avatar_url":"https://avatars.githubusercontent.com/u/7311132?v=3","gravatar_id":"","url":"https://api.github.com/users/prallabh","html_url":"https://github.com/prallabh","followers_url":"https://api.github.com/users/prallabh/followers","following_url":"https://api.github.com/users/prallabh/following{/other_user}","gists_url":"https://api.github.com/users/prallabh/gists{/gist_id}","starred_url":"https://api.github.com/users/prallabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prallabh/subscriptions","organizations_url":"https://api.github.com/users/prallabh/orgs","repos_url":"https://api.github.com/users/prallabh/repos","events_url":"https://api.github.com/users/prallabh/events{/privacy}","received_events_url":"https://api.github.com/users/prallabh/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-05-23T09:48:11Z","updated_at":"2016-05-23T09:48:11Z","html_url":"https://github.com/ceph/ceph/pull/8679#discussion_r64195287","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/8679","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/64195287"},"html":{"href":"https://github.com/ceph/ceph/pull/8679#discussion_r64195287"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8679"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/8679","id":67332803,"html_url":"https://github.com/ceph/ceph/pull/8679","diff_url":"https://github.com/ceph/ceph/pull/8679.diff","patch_url":"https://github.com/ceph/ceph/pull/8679.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/8679","number":8679,"state":"open","locked":false,"title":"rgw: Have a flavor of bucket deletion to bypass GC.","user":{"login":"prallabh","id":7311132,"avatar_url":"https://avatars.githubusercontent.com/u/7311132?v=3","gravatar_id":"","url":"https://api.github.com/users/prallabh","html_url":"https://github.com/prallabh","followers_url":"https://api.github.com/users/prallabh/followers","following_url":"https://api.github.com/users/prallabh/following{/other_user}","gists_url":"https://api.github.com/users/prallabh/gists{/gist_id}","starred_url":"https://api.github.com/users/prallabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prallabh/subscriptions","organizations_url":"https://api.github.com/users/prallabh/orgs","repos_url":"https://api.github.com/users/prallabh/repos","events_url":"https://api.github.com/users/prallabh/events{/privacy}","received_events_url":"https://api.github.com/users/prallabh/received_events","type":"User","site_admin":false},"body":"And to possibly speed up the object deletions by making them async\r\n\r\nFixes: http://tracker.ceph.com/issues/15557\r\nSigned-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>","created_at":"2016-04-21T10:43:35Z","updated_at":"2016-05-23T09:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5cb78991c588202fa4004907b4e079e595ac7a9","assignee":{"login":"yehudasa","id":1036377,"avatar_url":"https://avatars.githubusercontent.com/u/1036377?v=3","gravatar_id":"","url":"https://api.github.com/users/yehudasa","html_url":"https://github.com/yehudasa","followers_url":"https://api.github.com/users/yehudasa/followers","following_url":"https://api.github.com/users/yehudasa/following{/other_user}","gists_url":"https://api.github.com/users/yehudasa/gists{/gist_id}","starred_url":"https://api.github.com/users/yehudasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yehudasa/subscriptions","organizations_url":"https://api.github.com/users/yehudasa/orgs","repos_url":"https://api.github.com/users/yehudasa/repos","events_url":"https://api.github.com/users/yehudasa/events{/privacy}","received_events_url":"https://api.github.com/users/yehudasa/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/8679/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/8679/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/8679/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/3b1a7dee5fb53b854bbe57f4452ac63d0562553b","head":{"label":"prallabh:master","ref":"master","sha":"3b1a7dee5fb53b854bbe57f4452ac63d0562553b","user":{"login":"prallabh","id":7311132,"avatar_url":"https://avatars.githubusercontent.com/u/7311132?v=3","gravatar_id":"","url":"https://api.github.com/users/prallabh","html_url":"https://github.com/prallabh","followers_url":"https://api.github.com/users/prallabh/followers","following_url":"https://api.github.com/users/prallabh/following{/other_user}","gists_url":"https://api.github.com/users/prallabh/gists{/gist_id}","starred_url":"https://api.github.com/users/prallabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prallabh/subscriptions","organizations_url":"https://api.github.com/users/prallabh/orgs","repos_url":"https://api.github.com/users/prallabh/repos","events_url":"https://api.github.com/users/prallabh/events{/privacy}","received_events_url":"https://api.github.com/users/prallabh/received_events","type":"User","site_admin":false},"repo":{"id":33653879,"name":"ceph-1","full_name":"prallabh/ceph-1","owner":{"login":"prallabh","id":7311132,"avatar_url":"https://avatars.githubusercontent.com/u/7311132?v=3","gravatar_id":"","url":"https://api.github.com/users/prallabh","html_url":"https://github.com/prallabh","followers_url":"https://api.github.com/users/prallabh/followers","following_url":"https://api.github.com/users/prallabh/following{/other_user}","gists_url":"https://api.github.com/users/prallabh/gists{/gist_id}","starred_url":"https://api.github.com/users/prallabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prallabh/subscriptions","organizations_url":"https://api.github.com/users/prallabh/orgs","repos_url":"https://api.github.com/users/prallabh/repos","events_url":"https://api.github.com/users/prallabh/events{/privacy}","received_events_url":"https://api.github.com/users/prallabh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/prallabh/ceph-1","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/prallabh/ceph-1","forks_url":"https://api.github.com/repos/prallabh/ceph-1/forks","keys_url":"https://api.github.com/repos/prallabh/ceph-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prallabh/ceph-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prallabh/ceph-1/teams","hooks_url":"https://api.github.com/repos/prallabh/ceph-1/hooks","issue_events_url":"https://api.github.com/repos/prallabh/ceph-1/issues/events{/number}","events_url":"https://api.github.com/repos/prallabh/ceph-1/events","assignees_url":"https://api.github.com/repos/prallabh/ceph-1/assignees{/user}","branches_url":"https://api.github.com/repos/prallabh/ceph-1/branches{/branch}","tags_url":"https://api.github.com/repos/prallabh/ceph-1/tags","blobs_url":"https://api.github.com/repos/prallabh/ceph-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prallabh/ceph-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prallabh/ceph-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/prallabh/ceph-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prallabh/ceph-1/statuses/{sha}","languages_url":"https://api.github.com/repos/prallabh/ceph-1/languages","stargazers_url":"https://api.github.com/repos/prallabh/ceph-1/stargazers","contributors_url":"https://api.github.com/repos/prallabh/ceph-1/contributors","subscribers_url":"https://api.github.com/repos/prallabh/ceph-1/subscribers","subscription_url":"https://api.github.com/repos/prallabh/ceph-1/subscription","commits_url":"https://api.github.com/repos/prallabh/ceph-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/prallabh/ceph-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/prallabh/ceph-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/prallabh/ceph-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/prallabh/ceph-1/contents/{+path}","compare_url":"https://api.github.com/repos/prallabh/ceph-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prallabh/ceph-1/merges","archive_url":"https://api.github.com/repos/prallabh/ceph-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prallabh/ceph-1/downloads","issues_url":"https://api.github.com/repos/prallabh/ceph-1/issues{/number}","pulls_url":"https://api.github.com/repos/prallabh/ceph-1/pulls{/number}","milestones_url":"https://api.github.com/repos/prallabh/ceph-1/milestones{/number}","notifications_url":"https://api.github.com/repos/prallabh/ceph-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prallabh/ceph-1/labels{/name}","releases_url":"https://api.github.com/repos/prallabh/ceph-1/releases{/id}","deployments_url":"https://api.github.com/repos/prallabh/ceph-1/deployments","created_at":"2015-04-09T07:05:40Z","updated_at":"2016-04-19T08:53:35Z","pushed_at":"2016-05-23T09:45:05Z","git_url":"git://github.com/prallabh/ceph-1.git","ssh_url":"git@github.com:prallabh/ceph-1.git","clone_url":"https://github.com/prallabh/ceph-1.git","svn_url":"https://github.com/prallabh/ceph-1","homepage":"http://ceph.com","size":156430,"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":"30af2cd071c91be1877ce226470af4f87dd4b358","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-23T08:42:31Z","pushed_at":"2016-05-23T09:45:06Z","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":214605,"stargazers_count":2168,"watchers_count":2168,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1278,"mirror_url":null,"open_issues_count":339,"forks":1278,"open_issues":339,"watchers":2168,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8679"},"html":{"href":"https://github.com/ceph/ceph/pull/8679"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/8679"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/8679/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8679/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/8679/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/3b1a7dee5fb53b854bbe57f4452ac63d0562553b"}}}}
{"actor":{"display_login":"prallabh"}}