{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/220362305","pull_request_review_id":158753891,"id":220362305,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDM2MjMwNQ==","diff_hunk":"@@ -103,16 +106,19 @@ public TransportBulkShardOperationsAction(\n             }\n             return operationWithPrimaryTerm;\n         }).collect(Collectors.toList());\n-        // TODO: Replace this artificial value by the actual max_seq_no_updates from the leader\n-        targetOperations.stream().mapToLong(Translog.Operation::seqNo).max().ifPresent(primary::advanceMaxSeqNoOfUpdatesOrDeletes);\n+        assert maxSeqNoOfUpdatesOrDeletes >= SequenceNumbers.NO_OPS_PERFORMED : \"invalid msu [\" + maxSeqNoOfUpdatesOrDeletes + \"]\";\n+        primary.advanceMaxSeqNoOfUpdatesOrDeletes(maxSeqNoOfUpdatesOrDeletes);\n         final Translog.Location location = applyTranslogOperations(targetOperations, primary, Engine.Operation.Origin.PRIMARY);\n-        final BulkShardOperationsRequest replicaRequest = new BulkShardOperationsRequest(shardId, targetOperations);\n+        final BulkShardOperationsRequest replicaRequest = new BulkShardOperationsRequest(\n+            shardId, targetOperations, maxSeqNoOfUpdatesOrDeletes);\n         return new CcrWritePrimaryResult(replicaRequest, location, primary, logger);\n     }\n \n     @Override\n     protected WriteReplicaResult<BulkShardOperationsRequest> shardOperationOnReplica(\n             final BulkShardOperationsRequest request, final IndexShard replica) throws Exception {\n+        assert replica.getMaxSeqNoOfUpdatesOrDeletes() >= request.getMaxSeqNoOfUpdatesOrDeletes() :","path":"x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/bulk/TransportBulkShardOperationsAction.java","position":43,"original_position":43,"commit_id":"9635997a5a37190a083debc3e3c153cef234c51b","original_commit_id":"9635997a5a37190a083debc3e3c153cef234c51b","user":{"login":"bleskes","id":1006375,"node_id":"MDQ6VXNlcjEwMDYzNzU=","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":"💯 ","created_at":"2018-09-25T21:29:47Z","updated_at":"2018-09-25T21:34:42Z","html_url":"https://github.com/elastic/elasticsearch/pull/34051#discussion_r220362305","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/220362305"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/34051#discussion_r220362305"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051","id":217995410,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3OTk1NDEw","html_url":"https://github.com/elastic/elasticsearch/pull/34051","diff_url":"https://github.com/elastic/elasticsearch/pull/34051.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/34051.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/34051","number":34051,"state":"open","locked":false,"title":"CCR: replicates max seq_no of updates to follower","user":{"login":"dnhatn","id":13474362,"node_id":"MDQ6VXNlcjEzNDc0MzYy","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":"This commit replicates the max_seq_no_of_updates on the leading index to\r\nthe primaries of the following index via ShardFollowNodeTask. The\r\nmax_seq_of_updates is then transmitted to the replicas of the follower\r\nvia replication requests (that's BulkShardOperationsRequest).\r\n\r\nRelates #33656","created_at":"2018-09-25T14:10:34Z","updated_at":"2018-09-25T21:34:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96d4ee1909bad43fa241ab86a44a0447ed211d2c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jasontedor","id":4744941,"node_id":"MDQ6VXNlcjQ3NDQ5NDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4744941?v=4","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":912824565,"node_id":"MDU6TGFiZWw5MTI4MjQ1NjU=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Distributed/CCR","name":":Distributed/CCR","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/34051/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/9635997a5a37190a083debc3e3c153cef234c51b","head":{"label":"dnhatn:ccr-msu","ref":"ccr-msu","sha":"9635997a5a37190a083debc3e3c153cef234c51b","user":{"login":"dnhatn","id":13474362,"node_id":"MDQ6VXNlcjEzNDc0MzYy","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,"node_id":"MDEwOlJlcG9zaXRvcnk5NDkxMDQ1NQ==","name":"elasticsearch","full_name":"dnhatn/elasticsearch","private":false,"owner":{"login":"dnhatn","id":13474362,"node_id":"MDQ6VXNlcjEzNDc0MzYy","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},"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":"2018-09-21T20:14:06Z","pushed_at":"2018-09-25T14:09:22Z","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":487604,"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":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"16956a1a0530cc37aa68ff0e59d9c7e067357d82","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","private":false,"owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","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},"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-09-25T21:22:50Z","pushed_at":"2018-09-25T21:30:04Z","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":515551,"stargazers_count":34647,"watchers_count":34647,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11741,"mirror_url":null,"archived":false,"open_issues_count":1680,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11741,"open_issues":1680,"watchers":34647,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/34051"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/34051"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/34051/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/34051/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/9635997a5a37190a083debc3e3c153cef234c51b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bleskes"}}