{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/92936793","pull_request_review_id":13460098,"id":92936793,"diff_hunk":"@@ -36,25 +36,41 @@ class Replica(val brokerId: Int,\n   // for local replica it is the log's end offset, for remote replicas its value is only updated by follower fetch\n   @volatile private[this] var logEndOffsetMetadata: LogOffsetMetadata = LogOffsetMetadata.UnknownOffsetMetadata\n \n+  // The log end offset value at the time the leader receives last FetchRequest from this follower.\n+  // This is used to determine the last catch-up time of the follower\n+  @volatile var lastFetchLeaderLogEndOffset: Long = 0L\n+\n+  // The time when the leader receives last FetchRequest from this follower\n+  // This is used to determine the last catch-up time of the follower\n+  @volatile var lastFetchTimeMs: Long = 0L\n+\n   val topic = partition.topic\n   val partitionId = partition.partitionId\n \n   def isLocal: Boolean = log.isDefined\n \n+  // lastCatchUpTimeMs is the largest time t such that the begin offset of most recent FetchRequest from this follower >=\n+  // the LEO of leader at time t. This is used to determine the lag of this follower and ISR of this partition.\n   private[this] val lastCaughtUpTimeMsUnderlying = new AtomicLong(time.milliseconds)\n \n   def lastCaughtUpTimeMs = lastCaughtUpTimeMsUnderlying.get()\n \n+  /*\n+   * If the FetchRequest reads up to the log end offset of the leader when the current fetch request was received,\n+   * set the lastCaughtUpTimeMsUnderlying to the time when the current fetch request was received.\n+   *\n+   * Else if the FetchRequest reads up to the log end offset of the the leader when the previous fetch request was received,\n+   * set the lastCaughtUpTimeMsUnderlying to the time when the previous fetch request was received.","path":"core/src/main/scala/kafka/cluster/Replica.scala","position":28,"original_position":28,"commit_id":"4684fe54e6d52ac6bc8372a17ce4ef50a8d9a0a1","original_commit_id":"4684fe54e6d52ac6bc8372a17ce4ef50a8d9a0a1","user":{"login":"lindong28","id":5873403,"avatar_url":"https://avatars.githubusercontent.com/u/5873403?v=3","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"body":"Sure. Added comment now.","created_at":"2016-12-18T09:07:58Z","updated_at":"2016-12-18T09:07:58Z","html_url":"https://github.com/apache/kafka/pull/2208#discussion_r92936793","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/2208","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/92936793"},"html":{"href":"https://github.com/apache/kafka/pull/2208#discussion_r92936793"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/2208"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/2208","id":96384899,"html_url":"https://github.com/apache/kafka/pull/2208","diff_url":"https://github.com/apache/kafka/pull/2208.diff","patch_url":"https://github.com/apache/kafka/pull/2208.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/2208","number":2208,"state":"open","locked":false,"title":"KAFKA-4485; Follower should be in the isr if its FetchRequest has fetched up to the logEndOffset of leader","user":{"login":"lindong28","id":5873403,"avatar_url":"https://avatars.githubusercontent.com/u/5873403?v=3","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-03T03:34:24Z","updated_at":"2016-12-18T09:07:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7543d32337381c11a8ec53d1e2af32c14bb60019","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/2208/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/2208/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/2208/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/4684fe54e6d52ac6bc8372a17ce4ef50a8d9a0a1","head":{"label":"lindong28:KAFKA-4485","ref":"KAFKA-4485","sha":"4684fe54e6d52ac6bc8372a17ce4ef50a8d9a0a1","user":{"login":"lindong28","id":5873403,"avatar_url":"https://avatars.githubusercontent.com/u/5873403?v=3","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"repo":{"id":21054638,"name":"kafka","full_name":"lindong28/kafka","owner":{"login":"lindong28","id":5873403,"avatar_url":"https://avatars.githubusercontent.com/u/5873403?v=3","gravatar_id":"","url":"https://api.github.com/users/lindong28","html_url":"https://github.com/lindong28","followers_url":"https://api.github.com/users/lindong28/followers","following_url":"https://api.github.com/users/lindong28/following{/other_user}","gists_url":"https://api.github.com/users/lindong28/gists{/gist_id}","starred_url":"https://api.github.com/users/lindong28/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lindong28/subscriptions","organizations_url":"https://api.github.com/users/lindong28/orgs","repos_url":"https://api.github.com/users/lindong28/repos","events_url":"https://api.github.com/users/lindong28/events{/privacy}","received_events_url":"https://api.github.com/users/lindong28/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lindong28/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/lindong28/kafka","forks_url":"https://api.github.com/repos/lindong28/kafka/forks","keys_url":"https://api.github.com/repos/lindong28/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lindong28/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lindong28/kafka/teams","hooks_url":"https://api.github.com/repos/lindong28/kafka/hooks","issue_events_url":"https://api.github.com/repos/lindong28/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/lindong28/kafka/events","assignees_url":"https://api.github.com/repos/lindong28/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/lindong28/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/lindong28/kafka/tags","blobs_url":"https://api.github.com/repos/lindong28/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lindong28/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lindong28/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/lindong28/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lindong28/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/lindong28/kafka/languages","stargazers_url":"https://api.github.com/repos/lindong28/kafka/stargazers","contributors_url":"https://api.github.com/repos/lindong28/kafka/contributors","subscribers_url":"https://api.github.com/repos/lindong28/kafka/subscribers","subscription_url":"https://api.github.com/repos/lindong28/kafka/subscription","commits_url":"https://api.github.com/repos/lindong28/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/lindong28/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/lindong28/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/lindong28/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/lindong28/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/lindong28/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lindong28/kafka/merges","archive_url":"https://api.github.com/repos/lindong28/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lindong28/kafka/downloads","issues_url":"https://api.github.com/repos/lindong28/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/lindong28/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/lindong28/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/lindong28/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lindong28/kafka/labels{/name}","releases_url":"https://api.github.com/repos/lindong28/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/lindong28/kafka/deployments","created_at":"2014-06-20T22:40:57Z","updated_at":"2016-08-24T10:00:38Z","pushed_at":"2016-12-16T19:42:23Z","git_url":"git://github.com/lindong28/kafka.git","ssh_url":"git@github.com:lindong28/kafka.git","clone_url":"https://github.com/lindong28/kafka.git","svn_url":"https://github.com/lindong28/kafka","homepage":null,"size":36515,"stargazers_count":1,"watchers_count":1,"language":"Scala","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":1,"default_branch":"0.8.1"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"b58b6a1bef0ecdc2107a415e222af099fcd9bce3","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2016-12-18T08:19:51Z","pushed_at":"2016-12-18T08:53:26Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":37826,"stargazers_count":4292,"watchers_count":4292,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2674,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":311,"forks":2674,"open_issues":311,"watchers":4292,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/2208"},"html":{"href":"https://github.com/apache/kafka/pull/2208"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/2208"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/2208/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/2208/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/2208/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/4684fe54e6d52ac6bc8372a17ce4ef50a8d9a0a1"}}}}
{"actor":{"display_login":"lindong28"}}