{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/186282984","pull_request_review_id":117835780,"id":186282984,"diff_hunk":"@@ -3781,6 +3781,51 @@ protected long doGenerateSeqNoForOperation(Operation operation) {\n         }\n     }\n \n+    public void testSegmentContainsOnlyNoOps() throws Exception {\n+        Engine.NoOpResult noOpResult = engine.noOp(new Engine.NoOp(1, primaryTerm.get(), REPLICA, randomNonNegativeLong(), \"test\"));\n+        assertThat(noOpResult.getFailure(), nullValue());\n+        engine.refresh(\"test\");\n+        Engine.DeleteResult deleteResult = engine.delete(replicaDeleteForDoc(\"id\", 1, 2, randomNonNegativeLong()));\n+        assertThat(deleteResult.getFailure(), nullValue());\n+        engine.refresh(\"test\");\n+    }\n+\n+    public void testRandomOperations() throws Exception {","path":"server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java","position":13,"original_position":13,"commit_id":"aa030ff5548f16a284dcd3818a567aee467f4190","original_commit_id":"aa030ff5548f16a284dcd3818a567aee467f4190","user":{"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},"body":"can you add a comment as to why we have this test? something like \"a simple test to check that random combination of operations can coexist in segments and be read. This is needed as some fields in lucene may not exist if a segment misses operation types and the code needs to check for that\"","created_at":"2018-05-06T08:45:19Z","updated_at":"2018-05-06T08:46:44Z","html_url":"https://github.com/elastic/elasticsearch/pull/30409#discussion_r186282984","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/186282984"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/30409#discussion_r186282984"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409","id":186179436,"html_url":"https://github.com/elastic/elasticsearch/pull/30409","diff_url":"https://github.com/elastic/elasticsearch/pull/30409.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/30409.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/30409","number":30409,"state":"open","locked":false,"title":"Make _id and _version terms optional in a segment","user":{"login":"dnhatn","id":13474362,"avatar_url":"https://avatars3.githubusercontent.com/u/13474362?v=4","gravatar_id":"","url":"https://api.github.com/users/dnhatn","html_url":"https://github.com/dnhatn","followers_url":"https://api.github.com/users/dnhatn/followers","following_url":"https://api.github.com/users/dnhatn/following{/other_user}","gists_url":"https://api.github.com/users/dnhatn/gists{/gist_id}","starred_url":"https://api.github.com/users/dnhatn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnhatn/subscriptions","organizations_url":"https://api.github.com/users/dnhatn/orgs","repos_url":"https://api.github.com/users/dnhatn/repos","events_url":"https://api.github.com/users/dnhatn/events{/privacy}","received_events_url":"https://api.github.com/users/dnhatn/received_events","type":"User","site_admin":false},"body":"Previously only index and delete operations are indexed into Lucene,\r\ntherefore every segment should have both _id and _version terms as these\r\noperations contain both terms. However, this is no longer guaranteed\r\nafter noop is also indexed into Lucene. A segment which contains only\r\nno-ops does not have neither _id or _version because a no-op does not \r\ncontain these terms.\r\n\r\nThis change makes _id and _version terms optional in\r\nPerThreadIDVersionAndSeqNoLookup.\r\n\r\nRelates #30226","created_at":"2018-05-05T22:53:42Z","updated_at":"2018-05-06T08:46:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fa59b5cccf9be4c739176b7c5601328197ba9c6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jpountz","id":299848,"avatar_url":"https://avatars2.githubusercontent.com/u/299848?v=4","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},{"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}],"requested_teams":[],"labels":[{"id":836542781,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Distributed/Engine","name":":Distributed/Engine","color":"0e8a16","default":false},{"id":23172,"url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Efeature","name":">feature","color":"006b75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/30409/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/aa030ff5548f16a284dcd3818a567aee467f4190","head":{"label":"dnhatn:fix-segment-all-noops","ref":"fix-segment-all-noops","sha":"aa030ff5548f16a284dcd3818a567aee467f4190","user":{"login":"dnhatn","id":13474362,"avatar_url":"https://avatars3.githubusercontent.com/u/13474362?v=4","gravatar_id":"","url":"https://api.github.com/users/dnhatn","html_url":"https://github.com/dnhatn","followers_url":"https://api.github.com/users/dnhatn/followers","following_url":"https://api.github.com/users/dnhatn/following{/other_user}","gists_url":"https://api.github.com/users/dnhatn/gists{/gist_id}","starred_url":"https://api.github.com/users/dnhatn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnhatn/subscriptions","organizations_url":"https://api.github.com/users/dnhatn/orgs","repos_url":"https://api.github.com/users/dnhatn/repos","events_url":"https://api.github.com/users/dnhatn/events{/privacy}","received_events_url":"https://api.github.com/users/dnhatn/received_events","type":"User","site_admin":false},"repo":{"id":94910455,"name":"elasticsearch","full_name":"dnhatn/elasticsearch","owner":{"login":"dnhatn","id":13474362,"avatar_url":"https://avatars3.githubusercontent.com/u/13474362?v=4","gravatar_id":"","url":"https://api.github.com/users/dnhatn","html_url":"https://github.com/dnhatn","followers_url":"https://api.github.com/users/dnhatn/followers","following_url":"https://api.github.com/users/dnhatn/following{/other_user}","gists_url":"https://api.github.com/users/dnhatn/gists{/gist_id}","starred_url":"https://api.github.com/users/dnhatn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnhatn/subscriptions","organizations_url":"https://api.github.com/users/dnhatn/orgs","repos_url":"https://api.github.com/users/dnhatn/repos","events_url":"https://api.github.com/users/dnhatn/events{/privacy}","received_events_url":"https://api.github.com/users/dnhatn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dnhatn/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/dnhatn/elasticsearch","forks_url":"https://api.github.com/repos/dnhatn/elasticsearch/forks","keys_url":"https://api.github.com/repos/dnhatn/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnhatn/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnhatn/elasticsearch/teams","hooks_url":"https://api.github.com/repos/dnhatn/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/dnhatn/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/dnhatn/elasticsearch/events","assignees_url":"https://api.github.com/repos/dnhatn/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/dnhatn/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/dnhatn/elasticsearch/tags","blobs_url":"https://api.github.com/repos/dnhatn/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnhatn/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnhatn/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnhatn/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnhatn/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/dnhatn/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/dnhatn/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/dnhatn/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/dnhatn/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/dnhatn/elasticsearch/subscription","commits_url":"https://api.github.com/repos/dnhatn/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnhatn/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnhatn/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnhatn/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/dnhatn/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/dnhatn/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnhatn/elasticsearch/merges","archive_url":"https://api.github.com/repos/dnhatn/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnhatn/elasticsearch/downloads","issues_url":"https://api.github.com/repos/dnhatn/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/dnhatn/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/dnhatn/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/dnhatn/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnhatn/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/dnhatn/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/dnhatn/elasticsearch/deployments","created_at":"2017-06-20T16:05:45Z","updated_at":"2017-09-08T02:36:21Z","pushed_at":"2018-05-05T22:50:13Z","git_url":"git://github.com/dnhatn/elasticsearch.git","ssh_url":"git@github.com:dnhatn/elasticsearch.git","clone_url":"https://github.com/dnhatn/elasticsearch.git","svn_url":"https://github.com/dnhatn/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":428695,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"elastic:ccr","ref":"ccr","sha":"2c73969505e61e613d6194f2ebd08c2ea56d291b","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-05-06T08:42:47Z","pushed_at":"2018-05-06T05:27:15Z","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":477079,"stargazers_count":30719,"watchers_count":30719,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10637,"mirror_url":null,"archived":false,"open_issues_count":1454,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":10637,"open_issues":1454,"watchers":30719,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/30409"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/30409"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/30409/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/30409/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/aa030ff5548f16a284dcd3818a567aee467f4190"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bleskes"}}