{"action":"created","comment":{"url":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments/206933314","pull_request_review_id":142442333,"id":206933314,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjkzMzMxNA==","diff_hunk":"@@ -80,12 +80,24 @@ void ReplicatedMergeTreeCleanupThread::clearOldLogs()\n \n     Strings replicas = zookeeper->getChildren(storage.zookeeper_path + \"/replicas\", &stat);\n     UInt64 min_pointer = std::numeric_limits<UInt64>::max();\n+\n+    std::unordered_map<String, UInt64> log_pointers_lost_replicas;\n+    \n     for (const String & replica : replicas)\n     {\n         String pointer = zookeeper->get(storage.zookeeper_path + \"/replicas/\" + replica + \"/log_pointer\");\n-        if (pointer.empty())\n+        if (pointer.empty()) {\n             return;\n-        min_pointer = std::min(min_pointer, parse<UInt64>(pointer));\n+        }\n+        \n+        UInt32 log_pointer = parse<UInt64>(pointer);\n+        \n+        /// Check status of replica (active or not).\n+        /// If replica is not active, we will save it's log_pointer.\n+        if (zookeeper->exists(storage.zookeeper_path + \"/replicas/\" + replica + \"/is_active\"))","path":"dbms/src/Storages/MergeTree/ReplicatedMergeTreeCleanupThread.cpp","position":18,"original_position":20,"commit_id":"e2be3fd5ce434c055f57564eae7665725b158436","original_commit_id":"9b5620fac1e7fb5adb362acca872b91eabe77f8a","user":{"login":"VadimPE","id":18518081,"node_id":"MDQ6VXNlcjE4NTE4MDgx","avatar_url":"https://avatars1.githubusercontent.com/u/18518081?v=4","gravatar_id":"","url":"https://api.github.com/users/VadimPE","html_url":"https://github.com/VadimPE","followers_url":"https://api.github.com/users/VadimPE/followers","following_url":"https://api.github.com/users/VadimPE/following{/other_user}","gists_url":"https://api.github.com/users/VadimPE/gists{/gist_id}","starred_url":"https://api.github.com/users/VadimPE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VadimPE/subscriptions","organizations_url":"https://api.github.com/users/VadimPE/orgs","repos_url":"https://api.github.com/users/VadimPE/repos","events_url":"https://api.github.com/users/VadimPE/events{/privacy}","received_events_url":"https://api.github.com/users/VadimPE/received_events","type":"User","site_admin":false},"body":"@yurial Да, все верно.","created_at":"2018-08-01T15:45:00Z","updated_at":"2018-08-01T15:45:00Z","html_url":"https://github.com/yandex/ClickHouse/pull/2758#discussion_r206933314","pull_request_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments/206933314"},"html":{"href":"https://github.com/yandex/ClickHouse/pull/2758#discussion_r206933314"},"pull_request":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758"}},"in_reply_to_id":206503923},"pull_request":{"url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758","id":204861566,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0ODYxNTY2","html_url":"https://github.com/yandex/ClickHouse/pull/2758","diff_url":"https://github.com/yandex/ClickHouse/pull/2758.diff","patch_url":"https://github.com/yandex/ClickHouse/pull/2758.patch","issue_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2758","number":2758,"state":"open","locked":false,"title":"CLICKHOUSE-3847 add restore replica","user":{"login":"VadimPE","id":18518081,"node_id":"MDQ6VXNlcjE4NTE4MDgx","avatar_url":"https://avatars1.githubusercontent.com/u/18518081?v=4","gravatar_id":"","url":"https://api.github.com/users/VadimPE","html_url":"https://github.com/VadimPE","followers_url":"https://api.github.com/users/VadimPE/followers","following_url":"https://api.github.com/users/VadimPE/following{/other_user}","gists_url":"https://api.github.com/users/VadimPE/gists{/gist_id}","starred_url":"https://api.github.com/users/VadimPE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VadimPE/subscriptions","organizations_url":"https://api.github.com/users/VadimPE/orgs","repos_url":"https://api.github.com/users/VadimPE/repos","events_url":"https://api.github.com/users/VadimPE/events{/privacy}","received_events_url":"https://api.github.com/users/VadimPE/received_events","type":"User","site_admin":false},"body":"I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en\r\n","created_at":"2018-07-30T16:32:33Z","updated_at":"2018-08-01T15:45:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6d079623da7fff2b17e5d4d35eb4103c420fcfd","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ztlpn","id":2301957,"node_id":"MDQ6VXNlcjIzMDE5NTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2301957?v=4","gravatar_id":"","url":"https://api.github.com/users/ztlpn","html_url":"https://github.com/ztlpn","followers_url":"https://api.github.com/users/ztlpn/followers","following_url":"https://api.github.com/users/ztlpn/following{/other_user}","gists_url":"https://api.github.com/users/ztlpn/gists{/gist_id}","starred_url":"https://api.github.com/users/ztlpn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ztlpn/subscriptions","organizations_url":"https://api.github.com/users/ztlpn/orgs","repos_url":"https://api.github.com/users/ztlpn/repos","events_url":"https://api.github.com/users/ztlpn/events{/privacy}","received_events_url":"https://api.github.com/users/ztlpn/received_events","type":"User","site_admin":false},{"login":"alexey-milovidov","id":18581488,"node_id":"MDQ6VXNlcjE4NTgxNDg4","avatar_url":"https://avatars3.githubusercontent.com/u/18581488?v=4","gravatar_id":"","url":"https://api.github.com/users/alexey-milovidov","html_url":"https://github.com/alexey-milovidov","followers_url":"https://api.github.com/users/alexey-milovidov/followers","following_url":"https://api.github.com/users/alexey-milovidov/following{/other_user}","gists_url":"https://api.github.com/users/alexey-milovidov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexey-milovidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexey-milovidov/subscriptions","organizations_url":"https://api.github.com/users/alexey-milovidov/orgs","repos_url":"https://api.github.com/users/alexey-milovidov/repos","events_url":"https://api.github.com/users/alexey-milovidov/events{/privacy}","received_events_url":"https://api.github.com/users/alexey-milovidov/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758/commits","review_comments_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758/comments","review_comment_url":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/issues/2758/comments","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/e2be3fd5ce434c055f57564eae7665725b158436","head":{"label":"VadimPE:CLICKHOUSE-3847","ref":"CLICKHOUSE-3847","sha":"e2be3fd5ce434c055f57564eae7665725b158436","user":{"login":"VadimPE","id":18518081,"node_id":"MDQ6VXNlcjE4NTE4MDgx","avatar_url":"https://avatars1.githubusercontent.com/u/18518081?v=4","gravatar_id":"","url":"https://api.github.com/users/VadimPE","html_url":"https://github.com/VadimPE","followers_url":"https://api.github.com/users/VadimPE/followers","following_url":"https://api.github.com/users/VadimPE/following{/other_user}","gists_url":"https://api.github.com/users/VadimPE/gists{/gist_id}","starred_url":"https://api.github.com/users/VadimPE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VadimPE/subscriptions","organizations_url":"https://api.github.com/users/VadimPE/orgs","repos_url":"https://api.github.com/users/VadimPE/repos","events_url":"https://api.github.com/users/VadimPE/events{/privacy}","received_events_url":"https://api.github.com/users/VadimPE/received_events","type":"User","site_admin":false},"repo":{"id":141339425,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEzMzk0MjU=","name":"ClickHouse","full_name":"VadimPE/ClickHouse","owner":{"login":"VadimPE","id":18518081,"node_id":"MDQ6VXNlcjE4NTE4MDgx","avatar_url":"https://avatars1.githubusercontent.com/u/18518081?v=4","gravatar_id":"","url":"https://api.github.com/users/VadimPE","html_url":"https://github.com/VadimPE","followers_url":"https://api.github.com/users/VadimPE/followers","following_url":"https://api.github.com/users/VadimPE/following{/other_user}","gists_url":"https://api.github.com/users/VadimPE/gists{/gist_id}","starred_url":"https://api.github.com/users/VadimPE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VadimPE/subscriptions","organizations_url":"https://api.github.com/users/VadimPE/orgs","repos_url":"https://api.github.com/users/VadimPE/repos","events_url":"https://api.github.com/users/VadimPE/events{/privacy}","received_events_url":"https://api.github.com/users/VadimPE/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VadimPE/ClickHouse","description":"ClickHouse is a free analytic DBMS for big data.","fork":true,"url":"https://api.github.com/repos/VadimPE/ClickHouse","forks_url":"https://api.github.com/repos/VadimPE/ClickHouse/forks","keys_url":"https://api.github.com/repos/VadimPE/ClickHouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VadimPE/ClickHouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VadimPE/ClickHouse/teams","hooks_url":"https://api.github.com/repos/VadimPE/ClickHouse/hooks","issue_events_url":"https://api.github.com/repos/VadimPE/ClickHouse/issues/events{/number}","events_url":"https://api.github.com/repos/VadimPE/ClickHouse/events","assignees_url":"https://api.github.com/repos/VadimPE/ClickHouse/assignees{/user}","branches_url":"https://api.github.com/repos/VadimPE/ClickHouse/branches{/branch}","tags_url":"https://api.github.com/repos/VadimPE/ClickHouse/tags","blobs_url":"https://api.github.com/repos/VadimPE/ClickHouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VadimPE/ClickHouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VadimPE/ClickHouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/VadimPE/ClickHouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VadimPE/ClickHouse/statuses/{sha}","languages_url":"https://api.github.com/repos/VadimPE/ClickHouse/languages","stargazers_url":"https://api.github.com/repos/VadimPE/ClickHouse/stargazers","contributors_url":"https://api.github.com/repos/VadimPE/ClickHouse/contributors","subscribers_url":"https://api.github.com/repos/VadimPE/ClickHouse/subscribers","subscription_url":"https://api.github.com/repos/VadimPE/ClickHouse/subscription","commits_url":"https://api.github.com/repos/VadimPE/ClickHouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/VadimPE/ClickHouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/VadimPE/ClickHouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/VadimPE/ClickHouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/VadimPE/ClickHouse/contents/{+path}","compare_url":"https://api.github.com/repos/VadimPE/ClickHouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VadimPE/ClickHouse/merges","archive_url":"https://api.github.com/repos/VadimPE/ClickHouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VadimPE/ClickHouse/downloads","issues_url":"https://api.github.com/repos/VadimPE/ClickHouse/issues{/number}","pulls_url":"https://api.github.com/repos/VadimPE/ClickHouse/pulls{/number}","milestones_url":"https://api.github.com/repos/VadimPE/ClickHouse/milestones{/number}","notifications_url":"https://api.github.com/repos/VadimPE/ClickHouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VadimPE/ClickHouse/labels{/name}","releases_url":"https://api.github.com/repos/VadimPE/ClickHouse/releases{/id}","deployments_url":"https://api.github.com/repos/VadimPE/ClickHouse/deployments","created_at":"2018-07-17T20:21:03Z","updated_at":"2018-07-17T20:21:11Z","pushed_at":"2018-07-31T14:11:35Z","git_url":"git://github.com/VadimPE/ClickHouse.git","ssh_url":"git@github.com:VadimPE/ClickHouse.git","clone_url":"https://github.com/VadimPE/ClickHouse.git","svn_url":"https://github.com/VadimPE/ClickHouse","homepage":"https://clickhouse.yandex","size":90345,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":0,"default_branch":"master"}},"base":{"label":"yandex:master","ref":"master","sha":"7fe1914a635b99ce311d9ddf766d7d3cfe859f93","user":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"repo":{"id":60246359,"node_id":"MDEwOlJlcG9zaXRvcnk2MDI0NjM1OQ==","name":"ClickHouse","full_name":"yandex/ClickHouse","owner":{"login":"yandex","id":7409213,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MDkyMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/7409213?v=4","gravatar_id":"","url":"https://api.github.com/users/yandex","html_url":"https://github.com/yandex","followers_url":"https://api.github.com/users/yandex/followers","following_url":"https://api.github.com/users/yandex/following{/other_user}","gists_url":"https://api.github.com/users/yandex/gists{/gist_id}","starred_url":"https://api.github.com/users/yandex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yandex/subscriptions","organizations_url":"https://api.github.com/users/yandex/orgs","repos_url":"https://api.github.com/users/yandex/repos","events_url":"https://api.github.com/users/yandex/events{/privacy}","received_events_url":"https://api.github.com/users/yandex/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yandex/ClickHouse","description":"ClickHouse is a free analytic DBMS for big data.","fork":false,"url":"https://api.github.com/repos/yandex/ClickHouse","forks_url":"https://api.github.com/repos/yandex/ClickHouse/forks","keys_url":"https://api.github.com/repos/yandex/ClickHouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yandex/ClickHouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yandex/ClickHouse/teams","hooks_url":"https://api.github.com/repos/yandex/ClickHouse/hooks","issue_events_url":"https://api.github.com/repos/yandex/ClickHouse/issues/events{/number}","events_url":"https://api.github.com/repos/yandex/ClickHouse/events","assignees_url":"https://api.github.com/repos/yandex/ClickHouse/assignees{/user}","branches_url":"https://api.github.com/repos/yandex/ClickHouse/branches{/branch}","tags_url":"https://api.github.com/repos/yandex/ClickHouse/tags","blobs_url":"https://api.github.com/repos/yandex/ClickHouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yandex/ClickHouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yandex/ClickHouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/yandex/ClickHouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yandex/ClickHouse/statuses/{sha}","languages_url":"https://api.github.com/repos/yandex/ClickHouse/languages","stargazers_url":"https://api.github.com/repos/yandex/ClickHouse/stargazers","contributors_url":"https://api.github.com/repos/yandex/ClickHouse/contributors","subscribers_url":"https://api.github.com/repos/yandex/ClickHouse/subscribers","subscription_url":"https://api.github.com/repos/yandex/ClickHouse/subscription","commits_url":"https://api.github.com/repos/yandex/ClickHouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/yandex/ClickHouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/yandex/ClickHouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/yandex/ClickHouse/contents/{+path}","compare_url":"https://api.github.com/repos/yandex/ClickHouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yandex/ClickHouse/merges","archive_url":"https://api.github.com/repos/yandex/ClickHouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yandex/ClickHouse/downloads","issues_url":"https://api.github.com/repos/yandex/ClickHouse/issues{/number}","pulls_url":"https://api.github.com/repos/yandex/ClickHouse/pulls{/number}","milestones_url":"https://api.github.com/repos/yandex/ClickHouse/milestones{/number}","notifications_url":"https://api.github.com/repos/yandex/ClickHouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yandex/ClickHouse/labels{/name}","releases_url":"https://api.github.com/repos/yandex/ClickHouse/releases{/id}","deployments_url":"https://api.github.com/repos/yandex/ClickHouse/deployments","created_at":"2016-06-02T08:28:18Z","updated_at":"2018-08-01T14:50:41Z","pushed_at":"2018-08-01T14:50:01Z","git_url":"git://github.com/yandex/ClickHouse.git","ssh_url":"git@github.com:yandex/ClickHouse.git","clone_url":"https://github.com/yandex/ClickHouse.git","svn_url":"https://github.com/yandex/ClickHouse","homepage":"https://clickhouse.yandex","size":90973,"stargazers_count":4406,"watchers_count":4406,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":690,"mirror_url":null,"archived":false,"open_issues_count":497,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":690,"open_issues":497,"watchers":4406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758"},"html":{"href":"https://github.com/yandex/ClickHouse/pull/2758"},"issue":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2758"},"comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/issues/2758/comments"},"review_comments":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758/comments"},"review_comment":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yandex/ClickHouse/pulls/2758/commits"},"statuses":{"href":"https://api.github.com/repos/yandex/ClickHouse/statuses/e2be3fd5ce434c055f57564eae7665725b158436"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"VadimPE"}}