{"action":"created","comment":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/23553000","id":23553000,"diff_hunk":"@@ -465,23 +525,27 @@ public void snapshot(SnapshotIndexCommit snapshotIndexCommit) {\n                     }\n                     logger.trace(\"[{}] [{}] Processing [{}]\", shardId, snapshotId, fileName);\n                     final StoreFileMetaData md = metadata.get(fileName);\n-                    boolean snapshotRequired = false;\n-                    BlobStoreIndexShardSnapshot.FileInfo fileInfo = snapshots.findPhysicalIndexFile(fileName);\n-                    try {\n-                        // in 1.3.3 we added additional hashes for .si / segments_N files\n-                        // to ensure we don't double the space in the repo since old snapshots\n-                        // don't have this hash we try to read that hash from the blob store\n-                        // in a bwc compatible way.\n-                        maybeRecalculateMetadataHash(blobContainer, fileInfo, metadata);\n-                    }  catch (Throwable e) {\n-                        logger.warn(\"{} Can't calculate hash from blob for file [{}] [{}]\", e, shardId, fileInfo.physicalName(), fileInfo.metadata());\n-                    }\n-                    if (fileInfo == null || !fileInfo.isSame(md) || !snapshotFileExistsInBlobs(fileInfo, blobs)) {\n-                        // commit point file does not exists in any commit point, or has different length, or does not fully exists in the listed blobs\n-                        snapshotRequired = true;\n+                    FileInfo existingFileInfo = null;\n+                    ImmutableList<FileInfo> filesInfo = snapshots.findPhysicalIndexFiles(fileName);\n+                    if (filesInfo != null) {\n+                        for (FileInfo fileInfo : filesInfo) {\n+                            try {\n+                                // in 1.3.3 we added additional hashes for .si / segments_N files\n+                                // to ensure we don't double the space in the repo since old snapshots\n+                                // don't have this hash we try to read that hash from the blob store\n+                                // in a bwc compatible way.\n+                                maybeRecalculateMetadataHash(blobContainer, fileInfo, metadata);\n+                            } catch (Throwable e) {\n+                                logger.warn(\"{} Can't calculate hash from blob for file [{}] [{}]\", e, shardId, fileInfo.physicalName(), fileInfo.metadata());\n+                            }\n+                            if (fileInfo.isSame(md) && snapshotFileExistsInBlobs(fileInfo, blobs)) {\n+                                // commit point file does not exists in any commit point, or has different length, or does not fully exists in the listed blobs","path":"src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardRepository.java","position":208,"original_position":208,"commit_id":"ee3c3d14a257d781228b7c8486e7f6b0a2590253","original_commit_id":"ee3c3d14a257d781228b7c8486e7f6b0a2590253","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"body":"Indeed, I inverted code but forgot to invert the comment. Will fix.","created_at":"2015-01-26T18:41:07Z","updated_at":"2015-01-26T18:41:07Z","html_url":"https://github.com/elasticsearch/elasticsearch/pull/8969#discussion_r23553000","pull_request_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969","_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/23553000"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/8969#discussion_r23553000"},"pull_request":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969"}}},"pull_request":{"url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969","id":26103358,"html_url":"https://github.com/elasticsearch/elasticsearch/pull/8969","diff_url":"https://github.com/elasticsearch/elasticsearch/pull/8969.diff","patch_url":"https://github.com/elasticsearch/elasticsearch/pull/8969.patch","issue_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8969","number":8969,"state":"open","locked":false,"title":"Improve snapshot creation and deletion performance on repositories with ...","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"body":"...large number of snapshots\r\n\r\n Fixes #8958","created_at":"2014-12-15T21:34:48Z","updated_at":"2015-01-26T18:41:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b46c2397565f832b9f17b99fba0008d8a8cce62","assignee":{"login":"tlrx","id":642733,"avatar_url":"https://avatars.githubusercontent.com/u/642733?v=3","gravatar_id":"","url":"https://api.github.com/users/tlrx","html_url":"https://github.com/tlrx","followers_url":"https://api.github.com/users/tlrx/followers","following_url":"https://api.github.com/users/tlrx/following{/other_user}","gists_url":"https://api.github.com/users/tlrx/gists{/gist_id}","starred_url":"https://api.github.com/users/tlrx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlrx/subscriptions","organizations_url":"https://api.github.com/users/tlrx/orgs","repos_url":"https://api.github.com/users/tlrx/repos","events_url":"https://api.github.com/users/tlrx/events{/privacy}","received_events_url":"https://api.github.com/users/tlrx/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969/commits","review_comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969/comments","review_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8969/comments","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/ee3c3d14a257d781228b7c8486e7f6b0a2590253","head":{"label":"imotov:issue-8958-snapshot-scaling","ref":"issue-8958-snapshot-scaling","sha":"ee3c3d14a257d781228b7c8486e7f6b0a2590253","user":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"repo":{"id":1484646,"name":"elasticsearch","full_name":"imotov/elasticsearch","owner":{"login":"imotov","id":655851,"avatar_url":"https://avatars.githubusercontent.com/u/655851?v=3","gravatar_id":"","url":"https://api.github.com/users/imotov","html_url":"https://github.com/imotov","followers_url":"https://api.github.com/users/imotov/followers","following_url":"https://api.github.com/users/imotov/following{/other_user}","gists_url":"https://api.github.com/users/imotov/gists{/gist_id}","starred_url":"https://api.github.com/users/imotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imotov/subscriptions","organizations_url":"https://api.github.com/users/imotov/orgs","repos_url":"https://api.github.com/users/imotov/repos","events_url":"https://api.github.com/users/imotov/events{/privacy}","received_events_url":"https://api.github.com/users/imotov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imotov/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/imotov/elasticsearch","forks_url":"https://api.github.com/repos/imotov/elasticsearch/forks","keys_url":"https://api.github.com/repos/imotov/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imotov/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imotov/elasticsearch/teams","hooks_url":"https://api.github.com/repos/imotov/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/imotov/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/imotov/elasticsearch/events","assignees_url":"https://api.github.com/repos/imotov/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/imotov/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/imotov/elasticsearch/tags","blobs_url":"https://api.github.com/repos/imotov/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imotov/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imotov/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/imotov/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imotov/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/imotov/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/imotov/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/imotov/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/imotov/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/imotov/elasticsearch/subscription","commits_url":"https://api.github.com/repos/imotov/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/imotov/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/imotov/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/imotov/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/imotov/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/imotov/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imotov/elasticsearch/merges","archive_url":"https://api.github.com/repos/imotov/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imotov/elasticsearch/downloads","issues_url":"https://api.github.com/repos/imotov/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/imotov/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/imotov/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/imotov/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imotov/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/imotov/elasticsearch/releases{/id}","created_at":"2011-03-15T21:12:02Z","updated_at":"2014-06-19T21:59:06Z","pushed_at":"2015-01-25T01:07:07Z","git_url":"git://github.com/imotov/elasticsearch.git","ssh_url":"git@github.com:imotov/elasticsearch.git","clone_url":"https://github.com/imotov/elasticsearch.git","svn_url":"https://github.com/imotov/elasticsearch","homepage":"http://elasticsearch.org","size":74442,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"elasticsearch:master","ref":"master","sha":"f95fa83e5b3132f26fbaf648093e2000ecf41421","user":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elasticsearch/elasticsearch","owner":{"login":"elasticsearch","id":141304,"avatar_url":"https://avatars.githubusercontent.com/u/141304?v=3","gravatar_id":"","url":"https://api.github.com/users/elasticsearch","html_url":"https://github.com/elasticsearch","followers_url":"https://api.github.com/users/elasticsearch/followers","following_url":"https://api.github.com/users/elasticsearch/following{/other_user}","gists_url":"https://api.github.com/users/elasticsearch/gists{/gist_id}","starred_url":"https://api.github.com/users/elasticsearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elasticsearch/subscriptions","organizations_url":"https://api.github.com/users/elasticsearch/orgs","repos_url":"https://api.github.com/users/elasticsearch/repos","events_url":"https://api.github.com/users/elasticsearch/events{/privacy}","received_events_url":"https://api.github.com/users/elasticsearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elasticsearch/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elasticsearch/elasticsearch","forks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/forks","keys_url":"https://api.github.com/repos/elasticsearch/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elasticsearch/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elasticsearch/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elasticsearch/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elasticsearch/elasticsearch/events","assignees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elasticsearch/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elasticsearch/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elasticsearch/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elasticsearch/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elasticsearch/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/comments/{number}","contents_url":"https://api.github.com/repos/elasticsearch/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elasticsearch/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elasticsearch/elasticsearch/merges","archive_url":"https://api.github.com/repos/elasticsearch/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elasticsearch/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elasticsearch/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elasticsearch/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elasticsearch/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elasticsearch/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elasticsearch/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-01-26T17:37:15Z","pushed_at":"2015-01-26T18:40:46Z","git_url":"git://github.com/elasticsearch/elasticsearch.git","ssh_url":"git@github.com:elasticsearch/elasticsearch.git","clone_url":"https://github.com/elasticsearch/elasticsearch.git","svn_url":"https://github.com/elasticsearch/elasticsearch","homepage":"http://elasticsearch.org","size":263301,"stargazers_count":9733,"watchers_count":9733,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2983,"mirror_url":null,"open_issues_count":910,"forks":2983,"open_issues":910,"watchers":9733,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969"},"html":{"href":"https://github.com/elasticsearch/elasticsearch/pull/8969"},"issue":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8969"},"comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/issues/8969/comments"},"review_comments":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969/comments"},"review_comment":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/pulls/8969/commits"},"statuses":{"href":"https://api.github.com/repos/elasticsearch/elasticsearch/statuses/ee3c3d14a257d781228b7c8486e7f6b0a2590253"}}}}