

This will make the partition online even if the current leader is stopped as one of the other insync replicas can be chosen as a leader. This constraint will guard the follower replica not to go out of sync when a leader has some intermittent issues in processing fetch requests(especially read logs). This replica is always considered to be insync as long as there are pending requests. Fetch requests are added as pending requests while processing the fetch request in `ReplicaManager` if the fetch request’s message-offset >= leader’s LEO when the earlier fetch request is served.One way to address this issue is to have the below enhancement while considering a replica insync Replica is considered out of sync only if (Now - lastCaughtUpTime) > replicaLagTimeMax and its log-end-offset is not equal to leader’s log-end-offset. When a follower replica has the same log-end-offset as leader, then it is considered as insync replica irrespective of whether there are follower fetch requests within the replica lag max time or not. >= leader’s log-end-offset when the earlier fetch request was received.LastCaughtUptime is updated when the follower’s fetch offset This is set as the fetch request time in the leader partition before the request is served successfully. LastCaughtupTime represents the time at which a replica is considered caught up with the leader. This is used in computing last caught up time. Fetch request time of the earlier fetch request.Leader log end offset at the last fetch request.

Leader replica maintains state of each follower replica that includes This allows an insync follower replica can lag behind the leader replica upto 1.5 * .ms.

#Be insync update
Įach broker runs a ISR update task("isr-expiration") at regular intervals to update the metadata in ZK(directly or via controller if IBP version >= 2.7) about insync replicas of all the leader partitions of this broker. This allows a follower replica always tries its best to avoid going out of sync by sending frequent fetch requests within .ms. This will avoid frequent shrinking of ISRs. This property value should be less than the .ms so that a follower can send the next fetch request before a follower replica is considered out of sync. ms property represents wait time for each fetch request to be processed by the leader. They send fetch requests continuously and always try to catchup leader’s log-end-offset. In this case, other followers can not be leaders.įollower replicas send fetch requests to leader replica to replicate the messages for topic partitions.
#Be insync Offline
