{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/32370071","id":32370071,"diff_hunk":"@@ -442,15 +442,19 @@ void ECBackend::dispatch_recovery_messages(RecoveryMessages &m, int priority)\n     msg->compute_cost(cct);\n     replies.insert(make_pair(i->first.osd, msg));\n   }\n-  m.t->register_on_complete(\n-    get_parent()->bless_context(\n-      new SendPushReplies(\n-\tget_parent(),\n-\tget_parent()->get_epoch(),\n-\treplies)));\n-  m.t->register_on_applied(\n-    new ObjectStore::C_DeleteTransaction(m.t));\n-  get_parent()->queue_transaction(m.t);\n+  if (!replies.empty() || !m.t->empty()) {\n+    m.t->register_on_complete(\n+      get_parent()->bless_context(\n+        new SendPushReplies(\n+          get_parent(),\n+          get_parent()->get_epoch(),\n+          replies)));\n+    m.t->register_on_applied(\n+      new ObjectStore::C_DeleteTransaction(m.t));\n+    get_parent()->queue_transaction(m.t);\n+  } else {\n+    delete m.t;","path":"src/osd/ECBackend.cc","position":24,"original_position":24,"commit_id":"35aded85eec9c4634275547c15fdbd9c1dcf281e","original_commit_id":"35aded85eec9c4634275547c15fdbd9c1dcf281e","user":{"login":"dachary","id":433594,"avatar_url":"https://avatars.githubusercontent.com/u/433594?v=3","gravatar_id":"","url":"https://api.github.com/users/dachary","html_url":"https://github.com/dachary","followers_url":"https://api.github.com/users/dachary/followers","following_url":"https://api.github.com/users/dachary/following{/other_user}","gists_url":"https://api.github.com/users/dachary/gists{/gist_id}","starred_url":"https://api.github.com/users/dachary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dachary/subscriptions","organizations_url":"https://api.github.com/users/dachary/orgs","repos_url":"https://api.github.com/users/dachary/repos","events_url":"https://api.github.com/users/dachary/events{/privacy}","received_events_url":"https://api.github.com/users/dachary/received_events","type":"User","site_admin":false},"body":"I suspect m.t is a shared_ptr and you don't want that.","created_at":"2015-06-13T12:17:01Z","updated_at":"2015-06-13T12:17:01Z","html_url":"https://github.com/ceph/ceph/pull/4949#discussion_r32370071","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/4949","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/32370071"},"html":{"href":"https://github.com/ceph/ceph/pull/4949#discussion_r32370071"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4949"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/4949","id":37622024,"html_url":"https://github.com/ceph/ceph/pull/4949","diff_url":"https://github.com/ceph/ceph/pull/4949.diff","patch_url":"https://github.com/ceph/ceph/pull/4949.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/4949","number":4949,"state":"open","locked":false,"title":"osd: avoid emtpy transction when read in ec pool","user":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"body":"If i am not miss something, the transaction would be emtpy in \"no-recovery read\".\r\n\r\nSigned-off-by: Xinze Chi <xmdxcxz@gmail.com>","created_at":"2015-06-13T09:10:34Z","updated_at":"2015-06-13T12:17:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77f411738567a086f9148987c6e03aad6a9f26d1","assignee":{"login":"dachary","id":433594,"avatar_url":"https://avatars.githubusercontent.com/u/433594?v=3","gravatar_id":"","url":"https://api.github.com/users/dachary","html_url":"https://github.com/dachary","followers_url":"https://api.github.com/users/dachary/followers","following_url":"https://api.github.com/users/dachary/following{/other_user}","gists_url":"https://api.github.com/users/dachary/gists{/gist_id}","starred_url":"https://api.github.com/users/dachary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dachary/subscriptions","organizations_url":"https://api.github.com/users/dachary/orgs","repos_url":"https://api.github.com/users/dachary/repos","events_url":"https://api.github.com/users/dachary/events{/privacy}","received_events_url":"https://api.github.com/users/dachary/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/4949/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/4949/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/4949/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/35aded85eec9c4634275547c15fdbd9c1dcf281e","head":{"label":"XinzeChi:wip-ec-emtpy-trans","ref":"wip-ec-emtpy-trans","sha":"35aded85eec9c4634275547c15fdbd9c1dcf281e","user":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"repo":{"id":25850756,"name":"ceph","full_name":"XinzeChi/ceph","owner":{"login":"XinzeChi","id":3147032,"avatar_url":"https://avatars.githubusercontent.com/u/3147032?v=3","gravatar_id":"","url":"https://api.github.com/users/XinzeChi","html_url":"https://github.com/XinzeChi","followers_url":"https://api.github.com/users/XinzeChi/followers","following_url":"https://api.github.com/users/XinzeChi/following{/other_user}","gists_url":"https://api.github.com/users/XinzeChi/gists{/gist_id}","starred_url":"https://api.github.com/users/XinzeChi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XinzeChi/subscriptions","organizations_url":"https://api.github.com/users/XinzeChi/orgs","repos_url":"https://api.github.com/users/XinzeChi/repos","events_url":"https://api.github.com/users/XinzeChi/events{/privacy}","received_events_url":"https://api.github.com/users/XinzeChi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XinzeChi/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/XinzeChi/ceph","forks_url":"https://api.github.com/repos/XinzeChi/ceph/forks","keys_url":"https://api.github.com/repos/XinzeChi/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XinzeChi/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XinzeChi/ceph/teams","hooks_url":"https://api.github.com/repos/XinzeChi/ceph/hooks","issue_events_url":"https://api.github.com/repos/XinzeChi/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/XinzeChi/ceph/events","assignees_url":"https://api.github.com/repos/XinzeChi/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/XinzeChi/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/XinzeChi/ceph/tags","blobs_url":"https://api.github.com/repos/XinzeChi/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XinzeChi/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XinzeChi/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/XinzeChi/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XinzeChi/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/XinzeChi/ceph/languages","stargazers_url":"https://api.github.com/repos/XinzeChi/ceph/stargazers","contributors_url":"https://api.github.com/repos/XinzeChi/ceph/contributors","subscribers_url":"https://api.github.com/repos/XinzeChi/ceph/subscribers","subscription_url":"https://api.github.com/repos/XinzeChi/ceph/subscription","commits_url":"https://api.github.com/repos/XinzeChi/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/XinzeChi/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/XinzeChi/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/XinzeChi/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/XinzeChi/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/XinzeChi/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XinzeChi/ceph/merges","archive_url":"https://api.github.com/repos/XinzeChi/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XinzeChi/ceph/downloads","issues_url":"https://api.github.com/repos/XinzeChi/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/XinzeChi/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/XinzeChi/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/XinzeChi/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XinzeChi/ceph/labels{/name}","releases_url":"https://api.github.com/repos/XinzeChi/ceph/releases{/id}","created_at":"2014-10-28T03:06:13Z","updated_at":"2015-05-01T23:44:24Z","pushed_at":"2015-06-13T12:11:20Z","git_url":"git://github.com/XinzeChi/ceph.git","ssh_url":"git@github.com:XinzeChi/ceph.git","clone_url":"https://github.com/XinzeChi/ceph.git","svn_url":"https://github.com/XinzeChi/ceph","homepage":"http://ceph.com","size":124310,"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":"aa8a56391debdd895cdf6cf5a1cc7f273c00d554","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}","created_at":"2011-09-01T21:41:26Z","updated_at":"2015-06-13T03:21:52Z","pushed_at":"2015-06-13T10:55:46Z","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":432542,"stargazers_count":1366,"watchers_count":1366,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":745,"mirror_url":null,"open_issues_count":154,"forks":745,"open_issues":154,"watchers":1366,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4949"},"html":{"href":"https://github.com/ceph/ceph/pull/4949"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/4949"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/4949/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4949/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4949/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/35aded85eec9c4634275547c15fdbd9c1dcf281e"}}}}