Package com.linkedin.davinci.helix
Class LeaderFollowerPartitionStateModel
- java.lang.Object
-
- org.apache.helix.participant.statemachine.StateModel
-
- com.linkedin.davinci.helix.AbstractPartitionStateModel
-
- com.linkedin.davinci.helix.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. SeeLeaderFollowerStoreIngestionTask
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LeaderFollowerPartitionStateModel.LeaderSessionIdChecker
A leader session id checker will be created for each consumer action; server checks whether the session id is still valid before processing the consumer action.
-
Field Summary
-
Fields inherited from class com.linkedin.davinci.helix.AbstractPartitionStateModel
logger
-
-
Constructor Summary
Constructors Constructor Description LeaderFollowerPartitionStateModel(IngestionBackend ingestionBackend, VeniceStoreVersionConfig storeAndServerConfigs, int partition, LeaderFollowerIngestionProgressNotifier notifier, ReadOnlyStoreRepository metadataRepo, java.util.concurrent.CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, java.lang.String instanceName, ParticipantStateTransitionStats threadPoolStats, HeartbeatMonitoringService heartbeatMonitoringService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onBecomeDroppedFromOffline(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeLeaderFromStandby(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeOfflineFromDropped(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeOfflineFromError(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeOfflineFromStandby(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeStandbyFromLeader(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
void
onBecomeStandbyFromOffline(org.apache.helix.model.Message message, org.apache.helix.NotificationContext context)
-
Methods inherited from class com.linkedin.davinci.helix.AbstractPartitionStateModel
executeStateTransition, executeStateTransition, getIngestionBackend, getPartition, getStoreAndServerConfigs, getStoreIngestionService, getStorePartitionDescription, getStoreRepo, onBecomeDroppedFromError, removeCustomizedState, removePartitionFromStoreGracefully, reset, rollbackOnError, setupNewStorePartition, stopConsumption, waitConsumptionCompleted
-
-
-
-
Constructor Detail
-
LeaderFollowerPartitionStateModel
public LeaderFollowerPartitionStateModel(IngestionBackend ingestionBackend, VeniceStoreVersionConfig storeAndServerConfigs, int partition, LeaderFollowerIngestionProgressNotifier notifier, ReadOnlyStoreRepository metadataRepo, java.util.concurrent.CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, java.lang.String instanceName, ParticipantStateTransitionStats threadPoolStats, HeartbeatMonitoringService heartbeatMonitoringService)
-
-
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)
-
-