{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/65759153","id":65759153,"diff_hunk":"@@ -310,18 +310,20 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws\n     }\n \n     @Override\n-    public void merge(Mapper mergeWith, MergeResult mergeResult) {\n+    protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {\n         SourceFieldMapper sourceMergeWith = (SourceFieldMapper) mergeWith;\n-        if (mergeResult.simulate()) {\n-            if (this.enabled != sourceMergeWith.enabled) {\n-                mergeResult.addConflict(\"Cannot update enabled setting for [_source]\");\n-            }\n-            if (Arrays.equals(includes(), sourceMergeWith.includes()) == false) {\n-                mergeResult.addConflict(\"Cannot update includes setting for [_source]\");\n-            }\n-            if (Arrays.equals(excludes(), sourceMergeWith.excludes()) == false) {\n-                mergeResult.addConflict(\"Cannot update excludes setting for [_source]\");\n-            }\n+        List<String> conflicts = new ArrayList<>();\n+        if (this.enabled != sourceMergeWith.enabled) {\n+            conflicts.add(\"Cannot update enabled setting for [_source]\");\n+        }\n+        if (Arrays.equals(includes(), sourceMergeWith.includes()) == false) {\n+            conflicts.add(\"Cannot update includes setting for [_source]\");\n+        }\n+        if (Arrays.equals(excludes(), sourceMergeWith.excludes()) == false) {\n+            conflicts.add(\"Cannot update excludes setting for [_source]\");\n+        }\n+        if (conflicts.isEmpty() == false) {\n+            throw new IllegalArgumentException(\"Can't merge because of conflicts: \" + conflicts);\n         }","path":"core/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java","position":42,"original_position":42,"commit_id":"50eeafa75c122096377f37bd9553e7ac9e4d45b5","original_commit_id":"50eeafa75c122096377f37bd9553e7ac9e4d45b5","user":{"login":"sun","id":41992,"avatar_url":"https://avatars.githubusercontent.com/u/41992?v=3","gravatar_id":"","url":"https://api.github.com/users/sun","html_url":"https://github.com/sun","followers_url":"https://api.github.com/users/sun/followers","following_url":"https://api.github.com/users/sun/following{/other_user}","gists_url":"https://api.github.com/users/sun/gists{/gist_id}","starred_url":"https://api.github.com/users/sun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sun/subscriptions","organizations_url":"https://api.github.com/users/sun/orgs","repos_url":"https://api.github.com/users/sun/repos","events_url":"https://api.github.com/users/sun/events{/privacy}","received_events_url":"https://api.github.com/users/sun/received_events","type":"User","site_admin":false},"body":"It looks like this change also caused later modifications to `includes` and `excludes` to get denied.  Was that intentional?\r\n\r\nI wanted to add an exclude for an existing field mapping in the index, so that new documents indexed in the future will no longer store the raw (binary) input data as part of `_source` in the index.  I will have to rebuild the index now (which will take two days to complete).\r\n\r\nI would have expected that `includes` and `excludes` can be modified after the fact, but the definition will (obviously) only have an impact on newly indexed items.","created_at":"2016-06-03T18:58:57Z","updated_at":"2016-06-03T18:58:57Z","html_url":"https://github.com/elastic/elasticsearch/pull/15313#discussion_r65759153","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/65759153"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/15313#discussion_r65759153"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313","id":52990353,"html_url":"https://github.com/elastic/elasticsearch/pull/15313","diff_url":"https://github.com/elastic/elasticsearch/pull/15313.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/15313.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15313","number":15313,"state":"closed","locked":false,"title":"Make mappings immutable.","user":{"login":"jpountz","id":299848,"avatar_url":"https://avatars.githubusercontent.com/u/299848?v=3","gravatar_id":"","url":"https://api.github.com/users/jpountz","html_url":"https://github.com/jpountz","followers_url":"https://api.github.com/users/jpountz/followers","following_url":"https://api.github.com/users/jpountz/following{/other_user}","gists_url":"https://api.github.com/users/jpountz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpountz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpountz/subscriptions","organizations_url":"https://api.github.com/users/jpountz/orgs","repos_url":"https://api.github.com/users/jpountz/repos","events_url":"https://api.github.com/users/jpountz/events{/privacy}","received_events_url":"https://api.github.com/users/jpountz/received_events","type":"User","site_admin":false},"body":"Today mappings are mutable because of two APIs:\r\n - Mapper.merge, which expects changes to be performed in-place\r\n - IncludeInAll, which allows to change whether values should be put in the\r\n   `_all` field in place.\r\n\r\nThis commit changes both APIs to return a modified copy instead of modifying in\r\nplace so that mappings can be immutable. For now, only the type-level object is\r\nimmutable, but in the future we can imagine making them immutable at the\r\nindex-level so that mapping updates could be completely atomic at the index\r\nlevel.\r\n\r\nClose #9365","created_at":"2015-12-08T14:56:38Z","updated_at":"2016-06-03T18:58:57Z","closed_at":"2015-12-15T09:23:34Z","merged_at":"2015-12-15T09:23:34Z","merge_commit_sha":"7313b2c321d6f793e262f13851e5374b237cec1c","assignee":{"login":"rjernst","id":289412,"avatar_url":"https://avatars.githubusercontent.com/u/289412?v=3","gravatar_id":"","url":"https://api.github.com/users/rjernst","html_url":"https://github.com/rjernst","followers_url":"https://api.github.com/users/rjernst/followers","following_url":"https://api.github.com/users/rjernst/following{/other_user}","gists_url":"https://api.github.com/users/rjernst/gists{/gist_id}","starred_url":"https://api.github.com/users/rjernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjernst/subscriptions","organizations_url":"https://api.github.com/users/rjernst/orgs","repos_url":"https://api.github.com/users/rjernst/repos","events_url":"https://api.github.com/users/rjernst/events{/privacy}","received_events_url":"https://api.github.com/users/rjernst/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/15313/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/50eeafa75c122096377f37bd9553e7ac9e4d45b5","head":{"label":"jpountz:fix/immutable_mappings","ref":"fix/immutable_mappings","sha":"50eeafa75c122096377f37bd9553e7ac9e4d45b5","user":{"login":"jpountz","id":299848,"avatar_url":"https://avatars.githubusercontent.com/u/299848?v=3","gravatar_id":"","url":"https://api.github.com/users/jpountz","html_url":"https://github.com/jpountz","followers_url":"https://api.github.com/users/jpountz/followers","following_url":"https://api.github.com/users/jpountz/following{/other_user}","gists_url":"https://api.github.com/users/jpountz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpountz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpountz/subscriptions","organizations_url":"https://api.github.com/users/jpountz/orgs","repos_url":"https://api.github.com/users/jpountz/repos","events_url":"https://api.github.com/users/jpountz/events{/privacy}","received_events_url":"https://api.github.com/users/jpountz/received_events","type":"User","site_admin":false},"repo":{"id":9633891,"name":"elasticsearch","full_name":"jpountz/elasticsearch","owner":{"login":"jpountz","id":299848,"avatar_url":"https://avatars.githubusercontent.com/u/299848?v=3","gravatar_id":"","url":"https://api.github.com/users/jpountz","html_url":"https://github.com/jpountz","followers_url":"https://api.github.com/users/jpountz/followers","following_url":"https://api.github.com/users/jpountz/following{/other_user}","gists_url":"https://api.github.com/users/jpountz/gists{/gist_id}","starred_url":"https://api.github.com/users/jpountz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpountz/subscriptions","organizations_url":"https://api.github.com/users/jpountz/orgs","repos_url":"https://api.github.com/users/jpountz/repos","events_url":"https://api.github.com/users/jpountz/events{/privacy}","received_events_url":"https://api.github.com/users/jpountz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpountz/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/jpountz/elasticsearch","forks_url":"https://api.github.com/repos/jpountz/elasticsearch/forks","keys_url":"https://api.github.com/repos/jpountz/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpountz/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpountz/elasticsearch/teams","hooks_url":"https://api.github.com/repos/jpountz/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/jpountz/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/jpountz/elasticsearch/events","assignees_url":"https://api.github.com/repos/jpountz/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/jpountz/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/jpountz/elasticsearch/tags","blobs_url":"https://api.github.com/repos/jpountz/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpountz/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpountz/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpountz/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpountz/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/jpountz/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/jpountz/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/jpountz/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/jpountz/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/jpountz/elasticsearch/subscription","commits_url":"https://api.github.com/repos/jpountz/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpountz/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpountz/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpountz/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpountz/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/jpountz/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpountz/elasticsearch/merges","archive_url":"https://api.github.com/repos/jpountz/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpountz/elasticsearch/downloads","issues_url":"https://api.github.com/repos/jpountz/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/jpountz/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/jpountz/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/jpountz/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpountz/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/jpountz/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/jpountz/elasticsearch/deployments","created_at":"2013-04-23T21:37:49Z","updated_at":"2016-02-18T01:44:50Z","pushed_at":"2016-06-01T08:50:56Z","git_url":"git://github.com/jpountz/elasticsearch.git","ssh_url":"git@github.com:jpountz/elasticsearch.git","clone_url":"https://github.com/jpountz/elasticsearch.git","svn_url":"https://github.com/jpountz/elasticsearch","homepage":"http://elasticsearch.org","size":198581,"stargazers_count":4,"watchers_count":4,"language":"Java","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":4,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"ec908ddfd652cc66639653d98021b6cce9894f38","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-06-03T18:51:21Z","pushed_at":"2016-06-03T17:11:31Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":321762,"stargazers_count":16786,"watchers_count":16786,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5676,"mirror_url":null,"open_issues_count":1069,"forks":5676,"open_issues":1069,"watchers":16786,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/15313"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/15313"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/15313/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/15313/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/50eeafa75c122096377f37bd9553e7ac9e4d45b5"}}}}
{"actor":{"display_login":"sun"}}