{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/31654271","id":31654271,"diff_hunk":"@@ -125,11 +115,39 @@ int Dumper::dump(const char *dump_file)\n       ::close(fd);\n       return r;\n     }\n-    r = bl.write_fd(fd);\n-    if (r) {\n-      derr << \"Error \" << r << \" (\" << cpp_strerror(r) << \") writing journal file\" << dendl;\n-      ::close(fd);\n-      return r;\n+\n+\n+    // Read and write 32MB chunks.  Slower than it could be because we're not\n+    // streaming, but that's okay because this is just a debug/disaster tool.\n+    const uint32_t chunk_size = 32 * 1024 * 1024;\n+\n+    for (uint64_t pos = start; pos < start + len; pos += chunk_size) {\n+      bufferlist bl;\n+      dout(10) << \"Reading at pos=0x\" << std::hex << pos << std::dec << dendl;\n+\n+      const uint32_t read_size = MIN(chunk_size, end - pos);\n+\n+      C_SaferCond cond;\n+      lock.Lock();\n+      filer.read(ino, &journaler.get_layout(), CEPH_NOSNAP,\n+                 pos, read_size, &bl, 0, &cond);\n+      lock.Unlock();\n+      r = cond.wait();\n+      if (r < 0) {\n+        derr << \"Error \" << r << \" (\" << cpp_strerror(r) << \") reading \"\n+                \"journal at offset 0x\" << std::hex << pos << std::dec << dendl;","path":"src/tools/cephfs/Dumper.cc","position":59,"original_position":59,"commit_id":"e3ddcb894ad09326698999d42de0ce3feb69f28e","original_commit_id":"e3ddcb894ad09326698999d42de0ce3feb69f28e","user":{"login":"gregsfortytwo","id":908479,"avatar_url":"https://avatars.githubusercontent.com/u/908479?v=3","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},"body":"Given the other stuff we're doing to deal with disaster do you think this is okay, or should we just skip to the next chunk and dump either zeros or a sparse file?","created_at":"2015-06-03T18:29:41Z","updated_at":"2015-06-03T18:29:41Z","html_url":"https://github.com/ceph/ceph/pull/4835#discussion_r31654271","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/4835","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/31654271"},"html":{"href":"https://github.com/ceph/ceph/pull/4835#discussion_r31654271"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4835"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/4835","id":36811819,"html_url":"https://github.com/ceph/ceph/pull/4835","diff_url":"https://github.com/ceph/ceph/pull/4835.diff","patch_url":"https://github.com/ceph/ceph/pull/4835.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/4835","number":4835,"state":"open","locked":false,"title":"tools: chunk reads in Dumper","user":{"login":"jcsp","id":944640,"avatar_url":"https://avatars.githubusercontent.com/u/944640?v=3","gravatar_id":"","url":"https://api.github.com/users/jcsp","html_url":"https://github.com/jcsp","followers_url":"https://api.github.com/users/jcsp/followers","following_url":"https://api.github.com/users/jcsp/following{/other_user}","gists_url":"https://api.github.com/users/jcsp/gists{/gist_id}","starred_url":"https://api.github.com/users/jcsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcsp/subscriptions","organizations_url":"https://api.github.com/users/jcsp/orgs","repos_url":"https://api.github.com/users/jcsp/repos","events_url":"https://api.github.com/users/jcsp/events{/privacy}","received_events_url":"https://api.github.com/users/jcsp/received_events","type":"User","site_admin":false},"body":"Previously tried to read entire journal\r\ninto memory in one go, which was problematic\r\nfor large journals.\r\n\r\nFixes: #11746\r\nSigned-off-by: John Spray <john.spray@redhat.com>","created_at":"2015-06-03T09:07:11Z","updated_at":"2015-06-03T18:29:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be4346b55fdac4148907228c3261e27a02360892","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/4835/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/4835/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/4835/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/e3ddcb894ad09326698999d42de0ce3feb69f28e","head":{"label":"ceph:wip-11746","ref":"wip-11746","sha":"e3ddcb894ad09326698999d42de0ce3feb69f28e","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-03T03:38:48Z","pushed_at":"2015-06-03T18:20:34Z","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":432640,"stargazers_count":1350,"watchers_count":1350,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":730,"mirror_url":null,"open_issues_count":138,"forks":730,"open_issues":138,"watchers":1350,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"3ca1b50975498ec8c19c47e014eeddd2d2dbb352","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-03T03:38:48Z","pushed_at":"2015-06-03T18:20:34Z","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":432640,"stargazers_count":1350,"watchers_count":1350,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":730,"mirror_url":null,"open_issues_count":138,"forks":730,"open_issues":138,"watchers":1350,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4835"},"html":{"href":"https://github.com/ceph/ceph/pull/4835"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/4835"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/4835/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4835/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/4835/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/e3ddcb894ad09326698999d42de0ce3feb69f28e"}}}}