{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/27642953","id":27642953,"diff_hunk":"@@ -29,9 +29,18 @@\n public enum ClusterBlockLevel {\n     READ(0),\n     WRITE(1),\n-    METADATA(2);\n \n-    public static final EnumSet<ClusterBlockLevel> ALL = EnumSet.of(READ, WRITE, METADATA);\n+    /**\n+     * Since 1.5.1, METADATA has been splitted into two distincts cluster block levels","path":"src/main/java/org/elasticsearch/cluster/block/ClusterBlockLevel.java","position":8,"original_position":8,"commit_id":"5d09fc28d7cfb310c7d52f75a3863866bfe067dd","original_commit_id":"5d09fc28d7cfb310c7d52f75a3863866bfe067dd","user":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"body":"also, s/splitted/split","created_at":"2015-04-02T09:27:08Z","updated_at":"2015-04-02T09:27:08Z","html_url":"https://github.com/elastic/elasticsearch/pull/9203#discussion_r27642953","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/27642953"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/9203#discussion_r27642953"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203","id":27045025,"html_url":"https://github.com/elastic/elasticsearch/pull/9203","diff_url":"https://github.com/elastic/elasticsearch/pull/9203.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/9203.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/9203","number":9203,"state":"open","locked":false,"title":"Internal: Add METADATA_READ and METADATA_WRITE blocks","user":{"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},"body":"While looking at #3703, it looks like the usage of 'read_only' is a bit confusing.\r\n\r\nThe documentation stipulates:\r\n> index.blocks.read_only\r\n> Set to true to have the index read only, false to allow writes and metadata changes.\r\n\r\nActually, it blocks all write operations (creating, indexing or deleting a document) but also all read/write operations on index metadata. This can lead to confusion because subsequent 'indices exists' requests will return an undocumented 403 Forbidden response code where one could expect a 200 OK (as reported in #3703). Same for 'type exists' and 'alias exists' requests.\r\n\r\nSimilar issues have been reported:\r\n- _status #2833 (deprecated in 1.2.0)\r\n- _stats #5876\r\n- /_cat/indices #5855\r\n\r\nBut several API calls returns a 403 when at least one index of the cluster has 'index.blocks.read_only' set to true:\r\n```\r\nDELETE /_all\r\n\r\nPOST /library/book/1\r\n{\r\n  \"title\": \"Elasticsearch: the definitive guide\"\r\n}\r\n\r\nPOST /movies/dvd/1\r\n{\r\n  \"title\": \"Elasticsearch: the movie\"\r\n}\r\n\r\nPUT /library/_settings\r\n{\r\n  \"index\": {\r\n    \"blocks.read_only\": true\r\n  }\r\n}\r\n```\r\nThe following calls will return 403 / \"ClusterBlockException[blocked by: [FORBIDDEN/5/index read-only (api)];]\":\r\n```\r\nHEAD /library\r\nHEAD /library/book\r\nHEAD /_all/dvd\r\n\r\nGET /library/_settings\r\nGET /library/_mappings\r\nGET /library/_warmers\r\nGET /library/_aliases\r\n\r\nGET /_settings\r\nGET /_aliases\r\nGET /_mappings\r\nGET /_cat/indices\r\n```\r\nI agree to @imotov's comment (see https://github.com/elasticsearch/elasticsearch/pull/5876#issuecomment-42273841) and I think we should split the METADATA blocks in METADATA_READ & METADATA_WRITE blocks. This way the 'read_only' setting will block all write operations and metadata updates but the metadata will still be available.\r\n\r\nThis is a first step before updating all other actions then removing METADATA block completely.\r\n\r\nCloses #3703\r\nCloses #8102","created_at":"2015-01-08T17:32:57Z","updated_at":"2015-04-02T09:27:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"850ca5d6387a1ce2c15bbde7bdc9a92c9dca813d","assignee":{"login":"javanna","id":832460,"avatar_url":"https://avatars.githubusercontent.com/u/832460?v=3","gravatar_id":"","url":"https://api.github.com/users/javanna","html_url":"https://github.com/javanna","followers_url":"https://api.github.com/users/javanna/followers","following_url":"https://api.github.com/users/javanna/following{/other_user}","gists_url":"https://api.github.com/users/javanna/gists{/gist_id}","starred_url":"https://api.github.com/users/javanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javanna/subscriptions","organizations_url":"https://api.github.com/users/javanna/orgs","repos_url":"https://api.github.com/users/javanna/repos","events_url":"https://api.github.com/users/javanna/events{/privacy}","received_events_url":"https://api.github.com/users/javanna/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/9203/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/5d09fc28d7cfb310c7d52f75a3863866bfe067dd","head":{"label":"tlrx:blocks-metadata-read-write","ref":"blocks-metadata-read-write","sha":"5d09fc28d7cfb310c7d52f75a3863866bfe067dd","user":{"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},"repo":{"id":24718639,"name":"elasticsearch","full_name":"tlrx/elasticsearch","owner":{"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},"private":false,"html_url":"https://github.com/tlrx/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/tlrx/elasticsearch","forks_url":"https://api.github.com/repos/tlrx/elasticsearch/forks","keys_url":"https://api.github.com/repos/tlrx/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tlrx/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tlrx/elasticsearch/teams","hooks_url":"https://api.github.com/repos/tlrx/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/tlrx/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/tlrx/elasticsearch/events","assignees_url":"https://api.github.com/repos/tlrx/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/tlrx/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/tlrx/elasticsearch/tags","blobs_url":"https://api.github.com/repos/tlrx/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tlrx/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tlrx/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/tlrx/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tlrx/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/tlrx/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/tlrx/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/tlrx/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/tlrx/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/tlrx/elasticsearch/subscription","commits_url":"https://api.github.com/repos/tlrx/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/tlrx/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/tlrx/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/tlrx/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/tlrx/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/tlrx/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tlrx/elasticsearch/merges","archive_url":"https://api.github.com/repos/tlrx/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tlrx/elasticsearch/downloads","issues_url":"https://api.github.com/repos/tlrx/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/tlrx/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/tlrx/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/tlrx/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tlrx/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/tlrx/elasticsearch/releases{/id}","created_at":"2014-10-02T12:51:44Z","updated_at":"2014-10-02T08:42:36Z","pushed_at":"2015-04-01T12:22:57Z","git_url":"git://github.com/tlrx/elasticsearch.git","ssh_url":"git@github.com:tlrx/elasticsearch.git","clone_url":"https://github.com/tlrx/elasticsearch.git","svn_url":"https://github.com/tlrx/elasticsearch","homepage":"http://elasticsearch.org","size":94652,"stargazers_count":0,"watchers_count":0,"language":null,"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":"elastic:master","ref":"master","sha":"7c20a8a913cdd640bffeab82823378c748a923d3","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}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-04-02T09:17:01Z","pushed_at":"2015-04-02T09:17:01Z","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":"http://elasticsearch.org","size":311403,"stargazers_count":10605,"watchers_count":10605,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3310,"mirror_url":null,"open_issues_count":1091,"forks":3310,"open_issues":1091,"watchers":10605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/9203"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/9203"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/9203/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/9203/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/5d09fc28d7cfb310c7d52f75a3863866bfe067dd"}}}}