{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/203965080","pull_request_review_id":138960534,"id":203965080,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzk2NTA4MA==","diff_hunk":"@@ -297,6 +298,94 @@ class C_MDS_session_finish : public ServerLogContext {\n   }\n };\n \n+Session* Server::find_session_by_uuid(const std::string& uuid)\n+{\n+  Session* session = nullptr;\n+  for (auto& it : mds->sessionmap.get_sessions()) {\n+    auto& metadata = it.second->info.client_metadata;\n+\n+    auto p = metadata.find(\"uuid\");\n+    if (p == metadata.end() || p->second != uuid)\n+      continue;\n+\n+    if (!session) {\n+      session = it.second;\n+    } else if (!session->reclaiming_from) {\n+      assert(it.second->reclaiming_from == session);\n+      session = it.second;\n+    } else {\n+      assert(session->reclaiming_from == it.second);\n+    }\n+  }\n+  return session;\n+}\n+\n+void Server::reclaim_session(Session *session, MClientSession *m)\n+{\n+  if (!session->is_open() && !session->is_stale()) {\n+    dout(10) << \"session not open, dropping this req\" << dendl;\n+    return;\n+  }\n+\n+  MClientSession *reply = new MClientSession(CEPH_SESSION_RECLAIM_REPLY);\n+  auto it = m->metadata.find(\"uuid\");\n+  if (it == m->metadata.end()) {\n+    dout(10) << __func__ << \" invalid message (no uuid)\" << dendl;\n+    reply->metadata[\"reclaim_errno\"] = stringify(-EINVAL);\n+    mds->send_message_client(reply, session);\n+    return;\n+  }\n+  const auto& uuid = it->second;\n+\n+  unsigned flags = 0;\n+  it = m->metadata.find(\"flags\");\n+  if (it != m->metadata.end())\n+    flags = strtoul(it->second.c_str(), nullptr, 0);\n+\n+  if (flags != CEPH_RECLAIM_RESET) {","path":"src/mds/Server.cc","position":56,"original_position":56,"commit_id":"e94b85bb87c74064a3b595b3d2e73320ca68d325","original_commit_id":"e94b85bb87c74064a3b595b3d2e73320ca68d325","user":{"login":"ukernel","id":2775471,"node_id":"MDQ6VXNlcjI3NzU0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/2775471?v=4","gravatar_id":"","url":"https://api.github.com/users/ukernel","html_url":"https://github.com/ukernel","followers_url":"https://api.github.com/users/ukernel/followers","following_url":"https://api.github.com/users/ukernel/following{/other_user}","gists_url":"https://api.github.com/users/ukernel/gists{/gist_id}","starred_url":"https://api.github.com/users/ukernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukernel/subscriptions","organizations_url":"https://api.github.com/users/ukernel/orgs","repos_url":"https://api.github.com/users/ukernel/repos","events_url":"https://api.github.com/users/ukernel/events{/privacy}","received_events_url":"https://api.github.com/users/ukernel/received_events","type":"User","site_admin":false},"body":"that's too wasteful for feature bits","created_at":"2018-07-20T07:59:16Z","updated_at":"2018-07-20T07:59:17Z","html_url":"https://github.com/ceph/ceph/pull/23069#discussion_r203965080","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/23069","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/203965080"},"html":{"href":"https://github.com/ceph/ceph/pull/23069#discussion_r203965080"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23069"}},"in_reply_to_id":203184238},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/23069","id":201588165,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNTg4MTY1","html_url":"https://github.com/ceph/ceph/pull/23069","diff_url":"https://github.com/ceph/ceph/pull/23069.diff","patch_url":"https://github.com/ceph/ceph/pull/23069.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/23069","number":23069,"state":"open","locked":false,"title":"mds: initial code for client states reclaim","user":{"login":"ukernel","id":2775471,"node_id":"MDQ6VXNlcjI3NzU0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/2775471?v=4","gravatar_id":"","url":"https://api.github.com/users/ukernel","html_url":"https://github.com/ukernel","followers_url":"https://api.github.com/users/ukernel/followers","following_url":"https://api.github.com/users/ukernel/following{/other_user}","gists_url":"https://api.github.com/users/ukernel/gists{/gist_id}","starred_url":"https://api.github.com/users/ukernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukernel/subscriptions","organizations_url":"https://api.github.com/users/ukernel/orgs","repos_url":"https://api.github.com/users/ukernel/repos","events_url":"https://api.github.com/users/ukernel/events{/privacy}","received_events_url":"https://api.github.com/users/ukernel/received_events","type":"User","site_admin":false},"body":"original RP https://github.com/ceph/ceph/pull/20538","created_at":"2018-07-16T09:56:00Z","updated_at":"2018-07-20T07:59:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41f6470237a2b199c849e7ccb1f02305913b1d4e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":144329802,"node_id":"MDU6TGFiZWwxNDQzMjk4MDI=","url":"https://api.github.com/repos/ceph/ceph/labels/cephfs","name":"cephfs","color":"b192ff","default":false},{"id":134774006,"node_id":"MDU6TGFiZWwxMzQ3NzQwMDY=","url":"https://api.github.com/repos/ceph/ceph/labels/feature","name":"feature","color":"00ff24","default":false},{"id":340048817,"node_id":"MDU6TGFiZWwzNDAwNDg4MTc=","url":"https://api.github.com/repos/ceph/ceph/labels/needs-review","name":"needs-review","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/23069/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/23069/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/23069/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/e94b85bb87c74064a3b595b3d2e73320ca68d325","head":{"label":"ukernel:wip-cephfs-state-reclaim","ref":"wip-cephfs-state-reclaim","sha":"e94b85bb87c74064a3b595b3d2e73320ca68d325","user":{"login":"ukernel","id":2775471,"node_id":"MDQ6VXNlcjI3NzU0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/2775471?v=4","gravatar_id":"","url":"https://api.github.com/users/ukernel","html_url":"https://github.com/ukernel","followers_url":"https://api.github.com/users/ukernel/followers","following_url":"https://api.github.com/users/ukernel/following{/other_user}","gists_url":"https://api.github.com/users/ukernel/gists{/gist_id}","starred_url":"https://api.github.com/users/ukernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukernel/subscriptions","organizations_url":"https://api.github.com/users/ukernel/orgs","repos_url":"https://api.github.com/users/ukernel/repos","events_url":"https://api.github.com/users/ukernel/events{/privacy}","received_events_url":"https://api.github.com/users/ukernel/received_events","type":"User","site_admin":false},"repo":{"id":13721085,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyMTA4NQ==","name":"ceph","full_name":"ukernel/ceph","owner":{"login":"ukernel","id":2775471,"node_id":"MDQ6VXNlcjI3NzU0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/2775471?v=4","gravatar_id":"","url":"https://api.github.com/users/ukernel","html_url":"https://github.com/ukernel","followers_url":"https://api.github.com/users/ukernel/followers","following_url":"https://api.github.com/users/ukernel/following{/other_user}","gists_url":"https://api.github.com/users/ukernel/gists{/gist_id}","starred_url":"https://api.github.com/users/ukernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ukernel/subscriptions","organizations_url":"https://api.github.com/users/ukernel/orgs","repos_url":"https://api.github.com/users/ukernel/repos","events_url":"https://api.github.com/users/ukernel/events{/privacy}","received_events_url":"https://api.github.com/users/ukernel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ukernel/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/ukernel/ceph","forks_url":"https://api.github.com/repos/ukernel/ceph/forks","keys_url":"https://api.github.com/repos/ukernel/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ukernel/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ukernel/ceph/teams","hooks_url":"https://api.github.com/repos/ukernel/ceph/hooks","issue_events_url":"https://api.github.com/repos/ukernel/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ukernel/ceph/events","assignees_url":"https://api.github.com/repos/ukernel/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ukernel/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ukernel/ceph/tags","blobs_url":"https://api.github.com/repos/ukernel/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ukernel/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ukernel/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ukernel/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ukernel/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ukernel/ceph/languages","stargazers_url":"https://api.github.com/repos/ukernel/ceph/stargazers","contributors_url":"https://api.github.com/repos/ukernel/ceph/contributors","subscribers_url":"https://api.github.com/repos/ukernel/ceph/subscribers","subscription_url":"https://api.github.com/repos/ukernel/ceph/subscription","commits_url":"https://api.github.com/repos/ukernel/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ukernel/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ukernel/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ukernel/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ukernel/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ukernel/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ukernel/ceph/merges","archive_url":"https://api.github.com/repos/ukernel/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ukernel/ceph/downloads","issues_url":"https://api.github.com/repos/ukernel/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ukernel/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ukernel/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ukernel/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ukernel/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ukernel/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ukernel/ceph/deployments","created_at":"2013-10-20T15:10:44Z","updated_at":"2018-04-20T07:51:58Z","pushed_at":"2018-07-20T02:37:03Z","git_url":"git://github.com/ukernel/ceph.git","ssh_url":"git@github.com:ukernel/ceph.git","clone_url":"https://github.com/ukernel/ceph.git","svn_url":"https://github.com/ukernel/ceph","homepage":"http://ceph.com","size":272761,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"69725446c869ec0cce1cbdd4ba39a705846287b9","user":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkyMzEwNDk1","name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","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":"2018-07-20T07:41:02Z","pushed_at":"2018-07-20T07:46: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":299293,"stargazers_count":4819,"watchers_count":4819,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2534,"mirror_url":null,"archived":false,"open_issues_count":731,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2534,"open_issues":731,"watchers":4819,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23069"},"html":{"href":"https://github.com/ceph/ceph/pull/23069"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/23069"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/23069/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23069/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/23069/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/e94b85bb87c74064a3b595b3d2e73320ca68d325"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ukernel"}}