Class LeaderFollowerPartitionStateModel


  • public class LeaderFollowerPartitionStateModel
    extends AbstractPartitionStateModel
    Venice partition's state model to manage Leader/Follower(Standby) state transitions. Offline (Initial State) -> Follower (ideal state) -> Leader (ideal state) There is only at most one leader at a time and it is elected from the follower. At present, Followers and Leader behave the same in the read path. However, in the write path, leader will take extra work. See LeaderFollowerStoreIngestionTask for more details. There is an optional latch between Offline to Follower transition. The latch is only placed if the version state model served is the current version. (During cluster rebalancing or SN rebouncing) Since Helix rebalancer only refers to state model to determine the rebalancing time. The latch is a safe guard to prevent Helix "over-rebalancing" the cluster and failing the read traffic. The latch is released when ingestion has caught up the lag or the ingestion has reached the last known offset of VT.
    • Method Detail

      • onBecomeStandbyFromOffline

        public void onBecomeStandbyFromOffline​(org.apache.helix.model.Message message,
                                               org.apache.helix.NotificationContext context)
      • onBecomeLeaderFromStandby

        public void onBecomeLeaderFromStandby​(org.apache.helix.model.Message message,
                                              org.apache.helix.NotificationContext context)
      • onBecomeStandbyFromLeader

        public void onBecomeStandbyFromLeader​(org.apache.helix.model.Message message,
                                              org.apache.helix.NotificationContext context)
      • onBecomeOfflineFromStandby

        public void onBecomeOfflineFromStandby​(org.apache.helix.model.Message message,
                                               org.apache.helix.NotificationContext context)
      • onBecomeDroppedFromOffline

        public void onBecomeDroppedFromOffline​(org.apache.helix.model.Message message,
                                               org.apache.helix.NotificationContext context)
      • onBecomeOfflineFromDropped

        public void onBecomeOfflineFromDropped​(org.apache.helix.model.Message message,
                                               org.apache.helix.NotificationContext context)
      • onBecomeOfflineFromError

        public void onBecomeOfflineFromError​(org.apache.helix.model.Message message,
                                             org.apache.helix.NotificationContext context)