{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/177693200","pull_request_review_id":107599874,"id":177693200,"diff_hunk":"@@ -558,6 +560,25 @@ public GetResult get(Get get, BiFunction<String, SearcherScope, Searcher> search\n                         throw new VersionConflictEngineException(shardId, get.type(), get.id(),\n                             get.versionType().explainConflictForReads(versionValue.version, get.version()));\n                     }\n+                    if (get.isReadFromTranslog()) {\n+                        // this is only used for updates - API _GET calls will always read form a reader for consistency\n+                        // the update call doesn't need the consistency since it's source only + _parent but parent can go away in 7.0\n+                        if (versionValue.getLocation() != null) {\n+                            try {\n+                                Translog.Operation operation = translog.readOperation(versionValue.getLocation());\n+                                if (operation != null) {\n+                                    TranslogLeafReader reader = new TranslogLeafReader((Translog.Index) operation, engineConfig\n+                                        .getIndexSettings().getIndexVersionCreated());\n+                                    return new GetResult(new Searcher(\"realtime_get\", new IndexSearcher(reader)),\n+                                        new VersionsAndSeqNoResolver.DocIdAndVersion(0, ((Translog.Index) operation).version(), reader, 0));\n+                                }\n+                            } catch (IOException e) {\n+                                throw new EngineException(shardId, \"failed to read operation from translog\", e);","path":"server/src/main/java/org/elasticsearch/index/engine/InternalEngine.java","position":33,"original_position":33,"commit_id":"41a3c32dc6a23fa8708ddf476bb5f0f4d947e7ad","original_commit_id":"41a3c32dc6a23fa8708ddf476bb5f0f4d947e7ad","user":{"login":"ywelsch","id":3718355,"avatar_url":"https://avatars3.githubusercontent.com/u/3718355?v=4","gravatar_id":"","url":"https://api.github.com/users/ywelsch","html_url":"https://github.com/ywelsch","followers_url":"https://api.github.com/users/ywelsch/followers","following_url":"https://api.github.com/users/ywelsch/following{/other_user}","gists_url":"https://api.github.com/users/ywelsch/gists{/gist_id}","starred_url":"https://api.github.com/users/ywelsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywelsch/subscriptions","organizations_url":"https://api.github.com/users/ywelsch/orgs","repos_url":"https://api.github.com/users/ywelsch/repos","events_url":"https://api.github.com/users/ywelsch/events{/privacy}","received_events_url":"https://api.github.com/users/ywelsch/received_events","type":"User","site_admin":false},"body":"do we want to fail the engine (as we do when indexing)?","created_at":"2018-03-28T09:40:41Z","updated_at":"2018-03-28T09:47:55Z","html_url":"https://github.com/elastic/elasticsearch/pull/29264#discussion_r177693200","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/177693200"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/29264#discussion_r177693200"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264","id":177751049,"html_url":"https://github.com/elastic/elasticsearch/pull/29264","diff_url":"https://github.com/elastic/elasticsearch/pull/29264.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/29264.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/29264","number":29264,"state":"open","locked":false,"title":"Allow _update and upsert to read from the transaction log","user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars0.githubusercontent.com/u/973334?v=4","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"body":"We historically removed reading from the transaction log to get consistent\r\nresults from _GET calls. There was also the motivation that the read-modify-update\r\nprinciple we apply should not be hidden from the user. We still agree on the fact\r\nthat we should not hide these aspects but the impact on updates is quite significant\r\nespecially if the same documents is updated before it's written to disk and made serachable.\r\n\r\nThis change adds back the ability to read from the transaction log but only for update calls.\r\nCalls to the _GET API will always do a refresh if necessary to return consistent results ie.\r\nif stored fields or DocValues Fields are requested.","created_at":"2018-03-27T14:03:58Z","updated_at":"2018-03-28T09:47:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63b2a90a398a6aaaee0c11266f8088e1fee5d8a3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bleskes","id":1006375,"avatar_url":"https://avatars1.githubusercontent.com/u/1006375?v=4","gravatar_id":"","url":"https://api.github.com/users/bleskes","html_url":"https://github.com/bleskes","followers_url":"https://api.github.com/users/bleskes/followers","following_url":"https://api.github.com/users/bleskes/following{/other_user}","gists_url":"https://api.github.com/users/bleskes/gists{/gist_id}","starred_url":"https://api.github.com/users/bleskes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleskes/subscriptions","organizations_url":"https://api.github.com/users/bleskes/orgs","repos_url":"https://api.github.com/users/bleskes/repos","events_url":"https://api.github.com/users/bleskes/events{/privacy}","received_events_url":"https://api.github.com/users/bleskes/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":836542781,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Distributed/Engine","name":":Distributed/Engine","color":"0e8a16","default":false},{"id":23174,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Eenhancement","name":">enhancement","color":"4a4ea8","default":false},{"id":753477051,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v6.3.0","name":"v6.3.0","color":"DDDDDD","default":false},{"id":484855464,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/v7.0.0","name":"v7.0.0","color":"dddddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/29264/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/41a3c32dc6a23fa8708ddf476bb5f0f4d947e7ad","head":{"label":"s1monw:read_from_translog_for_updates","ref":"read_from_translog_for_updates","sha":"41a3c32dc6a23fa8708ddf476bb5f0f4d947e7ad","user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars0.githubusercontent.com/u/973334?v=4","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"repo":{"id":4663744,"name":"elasticsearch","full_name":"s1monw/elasticsearch","owner":{"login":"s1monw","id":973334,"avatar_url":"https://avatars0.githubusercontent.com/u/973334?v=4","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s1monw/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/s1monw/elasticsearch","forks_url":"https://api.github.com/repos/s1monw/elasticsearch/forks","keys_url":"https://api.github.com/repos/s1monw/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s1monw/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s1monw/elasticsearch/teams","hooks_url":"https://api.github.com/repos/s1monw/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/s1monw/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/s1monw/elasticsearch/events","assignees_url":"https://api.github.com/repos/s1monw/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/s1monw/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/s1monw/elasticsearch/tags","blobs_url":"https://api.github.com/repos/s1monw/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s1monw/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s1monw/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/s1monw/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s1monw/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/s1monw/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/s1monw/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/s1monw/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/s1monw/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/s1monw/elasticsearch/subscription","commits_url":"https://api.github.com/repos/s1monw/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/s1monw/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/s1monw/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/s1monw/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/s1monw/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/s1monw/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s1monw/elasticsearch/merges","archive_url":"https://api.github.com/repos/s1monw/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s1monw/elasticsearch/downloads","issues_url":"https://api.github.com/repos/s1monw/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/s1monw/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/s1monw/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/s1monw/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s1monw/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/s1monw/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/s1monw/elasticsearch/deployments","created_at":"2012-06-14T13:44:13Z","updated_at":"2018-03-26T11:50:49Z","pushed_at":"2018-03-27T19:20:22Z","git_url":"git://github.com/s1monw/elasticsearch.git","ssh_url":"git@github.com:s1monw/elasticsearch.git","clone_url":"https://github.com/s1monw/elasticsearch.git","svn_url":"https://github.com/s1monw/elasticsearch","homepage":"http://elasticsearch.org","size":353082,"stargazers_count":1,"watchers_count":1,"language":"Java","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"b4c78019b02313bd1eaa61e0752ef3c2cf34f5a4","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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://avatars0.githubusercontent.com/u/6764390?v=4","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":"2018-03-28T09:39:05Z","pushed_at":"2018-03-28T09:06:14Z","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":399618,"stargazers_count":29783,"watchers_count":29783,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10350,"mirror_url":null,"archived":false,"open_issues_count":1007,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":10350,"open_issues":1007,"watchers":29783,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/29264"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/29264"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/29264/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/29264/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/41a3c32dc6a23fa8708ddf476bb5f0f4d947e7ad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ywelsch"}}