{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/86854581","pull_request_review_id":7491431,"id":86854581,"diff_hunk":"@@ -513,76 +552,81 @@ map<pg_shard_t, ScrubMap *>::const_iterator\n     if (i == j->second->objects.end()) {\n       continue;\n     }\n-    if (i->second.read_error || i->second.stat_error) {\n-      // scrub encountered read error or stat_error, probably corrupt\n-      dout(10) << __func__ << \": rejecting osd \" << j->first\n-\t       << \" for obj \" << obj\n-\t       << \",\" << (i->second.read_error ? \" read_error\" : \"\")\n-\t       << (i->second.stat_error ? \" stat_error\" : \"\")\n-\t       << dendl;\n-      continue;\n+    string error_string;\n+    shard_map[j->first];\n+    if (i->second.read_error) {\n+      shard_map[j->first].set_read_error();\n+      error_string += \" read_error\";\n     }\n-    map<string, bufferptr>::iterator k = i->second.attrs.find(OI_ATTR);\n-    if (k == i->second.attrs.end()) {\n-      // no object info on object, probably corrupt\n-      dout(10) << __func__ << \": rejecting osd \" << j->first\n-\t       << \" for obj \" << obj\n-\t       << \", no oi attr\"\n-\t       << dendl;\n-      continue;\n+    if (i->second.ec_hash_mismatch) {\n+      shard_map[j->first].set_ec_hash_mismatch();\n+      error_string += \" ec_hash_mismatch\";\n+    }\n+    if (i->second.ec_size_mismatch) {\n+      shard_map[j->first].set_ec_size_mismatch();\n+      error_string += \" ec_size_mismatch\";\n     }\n \n+    object_info_t oi;\n     bufferlist bl;\n+    map<string, bufferptr>::iterator k;\n+\n+    if (i->second.stat_error) {\n+      shard_map[j->first].set_stat_error();\n+      error_string += \" stat_error\";\n+      // With stat_error no further checking\n+      // We don't need to also see a missing_object_info_attr\n+      goto out;\n+    }\n+\n+    k = i->second.attrs.find(OI_ATTR);\n+    if (k == i->second.attrs.end()) {\n+      // no object info on object, probably corrupt\n+      shard_map[j->first].set_oi_attr_missing();\n+      error_string += \" oi_attr_missing\";\n+      goto out;\n+    }\n     bl.push_back(k->second);\n-    object_info_t oi;\n     try {\n       bufferlist::iterator bliter = bl.begin();\n       ::decode(oi, bliter);\n     } catch (...) {\n-      dout(10) << __func__ << \": rejecting osd \" << j->first\n-\t       << \" for obj \" << obj\n-\t       << \", corrupt oi attr\"\n-\t       << dendl;\n       // invalid object info, probably corrupt\n-      continue;\n+      shard_map[j->first].set_oi_attr_corrupted();\n+      error_string += \" oi_attr_corrupted\";\n+      goto out;\n+    }\n+\n+    if (auth_version != eversion_t()) {\n+      if (!object_error.has_object_info_inconsistency() && !(bl == auth_bl)) {\n+\tobject_error.set_object_info_inconsistency();\n+\terror_string += \" object_info_inconsistency\";\n+      }\n     }\n \n-    // note candidate in case we can't find anything better, because\n-    // something is better than nothing.  FIXME.\n-    auth = j;\n-    *auth_oi = oi;\n+    // Don't use this particular shard because it won't be able to repair data\n+    // XXX: For now we can't pick one shard for repair and another's object info\n+    if (i->second.read_error || i->second.ec_hash_mismatch || i->second.ec_size_mismatch)\n+      goto out;\n+\n+    if (auth_version == eversion_t() || oi.version > auth_version ||\n+        (oi.version == auth_version && dcount(oi) > dcount(*auth_oi))) {\n+      auth = j;\n+      *auth_oi = oi;\n+      auth_version = oi.version;\n+      auth_bl.clear();","path":"src/osd/PGBackend.cc","position":280,"original_position":280,"commit_id":"4e737bc972aeca9b1442a1aa687b6e31c75c49e3","original_commit_id":"cd4d958ce6076cd18430657f433ed0763ac267af","user":{"login":"dzafman","id":2467610,"avatar_url":"https://avatars.githubusercontent.com/u/2467610?v=3","gravatar_id":"","url":"https://api.github.com/users/dzafman","html_url":"https://github.com/dzafman","followers_url":"https://api.github.com/users/dzafman/followers","following_url":"https://api.github.com/users/dzafman/following{/other_user}","gists_url":"https://api.github.com/users/dzafman/gists{/gist_id}","starred_url":"https://api.github.com/users/dzafman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzafman/subscriptions","organizations_url":"https://api.github.com/users/dzafman/orgs","repos_url":"https://api.github.com/users/dzafman/repos","events_url":"https://api.github.com/users/dzafman/events{/privacy}","received_events_url":"https://api.github.com/users/dzafman/received_events","type":"User","site_admin":false},"body":"It is hard to remember now, but I think when I did that it did work right because it didn't copy the bufferlist.  The next bl update would change auth_bl too.","created_at":"2016-11-07T19:52:40Z","updated_at":"2016-11-07T19:52:40Z","html_url":"https://github.com/ceph/ceph/pull/9613#discussion_r86854581","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/9613","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/86854581"},"html":{"href":"https://github.com/ceph/ceph/pull/9613#discussion_r86854581"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9613"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/9613","id":73266142,"html_url":"https://github.com/ceph/ceph/pull/9613","diff_url":"https://github.com/ceph/ceph/pull/9613.diff","patch_url":"https://github.com/ceph/ceph/pull/9613.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/9613","number":9613,"state":"open","locked":false,"title":"common osd: Improve scrub analysis, list-inconsistent-obj output and osd-scrub-repair test","user":{"login":"dzafman","id":2467610,"avatar_url":"https://avatars.githubusercontent.com/u/2467610?v=3","gravatar_id":"","url":"https://api.github.com/users/dzafman","html_url":"https://github.com/dzafman","followers_url":"https://api.github.com/users/dzafman/followers","following_url":"https://api.github.com/users/dzafman/following{/other_user}","gists_url":"https://api.github.com/users/dzafman/gists{/gist_id}","starred_url":"https://api.github.com/users/dzafman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzafman/subscriptions","organizations_url":"https://api.github.com/users/dzafman/orgs","repos_url":"https://api.github.com/users/dzafman/repos","events_url":"https://api.github.com/users/dzafman/events{/privacy}","received_events_url":"https://api.github.com/users/dzafman/received_events","type":"User","site_admin":false},"body":"Improve scrub mechanism to check all shards against object info\nObject errors are separate from shard errors\nosd: persist the user_version and shard id of scrubbed obj\ntools/rados: dump inconsistent obj's version and shard-id\nCreate list-inconsistent-\\* schemas in doc\nAdd test cases in osd-scrub-repair test\n","created_at":"2016-06-09T18:50:57Z","updated_at":"2016-11-07T19:52:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17bde41ab1f8b73a018311289a39d03c7253074e","assignee":{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"assignees":[{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},{"login":"athanatos","id":544782,"avatar_url":"https://avatars.githubusercontent.com/u/544782?v=3","gravatar_id":"","url":"https://api.github.com/users/athanatos","html_url":"https://github.com/athanatos","followers_url":"https://api.github.com/users/athanatos/followers","following_url":"https://api.github.com/users/athanatos/following{/other_user}","gists_url":"https://api.github.com/users/athanatos/gists{/gist_id}","starred_url":"https://api.github.com/users/athanatos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athanatos/subscriptions","organizations_url":"https://api.github.com/users/athanatos/orgs","repos_url":"https://api.github.com/users/athanatos/repos","events_url":"https://api.github.com/users/athanatos/events{/privacy}","received_events_url":"https://api.github.com/users/athanatos/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ceph/ceph/milestones/9","html_url":"https://github.com/ceph/ceph/milestones/kraken","labels_url":"https://api.github.com/repos/ceph/ceph/milestones/9/labels","id":1642631,"number":9,"title":"kraken","description":"","creator":{"login":"liewegas","id":433031,"avatar_url":"https://avatars.githubusercontent.com/u/433031?v=3","gravatar_id":"","url":"https://api.github.com/users/liewegas","html_url":"https://github.com/liewegas","followers_url":"https://api.github.com/users/liewegas/followers","following_url":"https://api.github.com/users/liewegas/following{/other_user}","gists_url":"https://api.github.com/users/liewegas/gists{/gist_id}","starred_url":"https://api.github.com/users/liewegas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liewegas/subscriptions","organizations_url":"https://api.github.com/users/liewegas/orgs","repos_url":"https://api.github.com/users/liewegas/repos","events_url":"https://api.github.com/users/liewegas/events{/privacy}","received_events_url":"https://api.github.com/users/liewegas/received_events","type":"User","site_admin":false},"open_issues":29,"closed_issues":65,"state":"open","created_at":"2016-03-14T12:28:24Z","updated_at":"2016-11-07T16:58:37Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/9613/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/9613/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/9613/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/4e737bc972aeca9b1442a1aa687b6e31c75c49e3","head":{"label":"dzafman:wip-16064","ref":"wip-16064","sha":"4e737bc972aeca9b1442a1aa687b6e31c75c49e3","user":{"login":"dzafman","id":2467610,"avatar_url":"https://avatars.githubusercontent.com/u/2467610?v=3","gravatar_id":"","url":"https://api.github.com/users/dzafman","html_url":"https://github.com/dzafman","followers_url":"https://api.github.com/users/dzafman/followers","following_url":"https://api.github.com/users/dzafman/following{/other_user}","gists_url":"https://api.github.com/users/dzafman/gists{/gist_id}","starred_url":"https://api.github.com/users/dzafman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzafman/subscriptions","organizations_url":"https://api.github.com/users/dzafman/orgs","repos_url":"https://api.github.com/users/dzafman/repos","events_url":"https://api.github.com/users/dzafman/events{/privacy}","received_events_url":"https://api.github.com/users/dzafman/received_events","type":"User","site_admin":false},"repo":{"id":7757983,"name":"ceph","full_name":"dzafman/ceph","owner":{"login":"dzafman","id":2467610,"avatar_url":"https://avatars.githubusercontent.com/u/2467610?v=3","gravatar_id":"","url":"https://api.github.com/users/dzafman","html_url":"https://github.com/dzafman","followers_url":"https://api.github.com/users/dzafman/followers","following_url":"https://api.github.com/users/dzafman/following{/other_user}","gists_url":"https://api.github.com/users/dzafman/gists{/gist_id}","starred_url":"https://api.github.com/users/dzafman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzafman/subscriptions","organizations_url":"https://api.github.com/users/dzafman/orgs","repos_url":"https://api.github.com/users/dzafman/repos","events_url":"https://api.github.com/users/dzafman/events{/privacy}","received_events_url":"https://api.github.com/users/dzafman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dzafman/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/dzafman/ceph","forks_url":"https://api.github.com/repos/dzafman/ceph/forks","keys_url":"https://api.github.com/repos/dzafman/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dzafman/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dzafman/ceph/teams","hooks_url":"https://api.github.com/repos/dzafman/ceph/hooks","issue_events_url":"https://api.github.com/repos/dzafman/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/dzafman/ceph/events","assignees_url":"https://api.github.com/repos/dzafman/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/dzafman/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/dzafman/ceph/tags","blobs_url":"https://api.github.com/repos/dzafman/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dzafman/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dzafman/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/dzafman/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dzafman/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/dzafman/ceph/languages","stargazers_url":"https://api.github.com/repos/dzafman/ceph/stargazers","contributors_url":"https://api.github.com/repos/dzafman/ceph/contributors","subscribers_url":"https://api.github.com/repos/dzafman/ceph/subscribers","subscription_url":"https://api.github.com/repos/dzafman/ceph/subscription","commits_url":"https://api.github.com/repos/dzafman/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/dzafman/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/dzafman/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/dzafman/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/dzafman/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/dzafman/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dzafman/ceph/merges","archive_url":"https://api.github.com/repos/dzafman/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dzafman/ceph/downloads","issues_url":"https://api.github.com/repos/dzafman/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/dzafman/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/dzafman/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/dzafman/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dzafman/ceph/labels{/name}","releases_url":"https://api.github.com/repos/dzafman/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/dzafman/ceph/deployments","created_at":"2013-01-22T18:07:43Z","updated_at":"2014-06-25T02:23:55Z","pushed_at":"2016-11-05T00:35:38Z","git_url":"git://github.com/dzafman/ceph.git","ssh_url":"git@github.com:dzafman/ceph.git","clone_url":"https://github.com/dzafman/ceph.git","svn_url":"https://github.com/dzafman/ceph","homepage":"http://ceph.com","size":172592,"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":"fac6335a1eea12270f76cf2c7814648669e6515a","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-11-07T14:36:04Z","pushed_at":"2016-11-07T19:29:23Z","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":247799,"stargazers_count":2604,"watchers_count":2604,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1537,"mirror_url":null,"open_issues_count":368,"forks":1537,"open_issues":368,"watchers":2604,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9613"},"html":{"href":"https://github.com/ceph/ceph/pull/9613"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/9613"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/9613/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9613/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/9613/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/4e737bc972aeca9b1442a1aa687b6e31c75c49e3"}}}}
{"actor":{"display_login":"dzafman"}}