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
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.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
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, WAIT_DROP_PARTITION_TIME_OUT_MS
Fields inherited from class org.apache.helix.participant.statemachine.StateModel
_cancelled, _currentState
-
Constructor Summary
ConstructorDescriptionLeaderFollowerPartitionStateModel
(IngestionBackend ingestionBackend, VeniceStoreVersionConfig storeAndServerConfigs, int partition, LeaderFollowerIngestionProgressNotifier notifier, ReadOnlyStoreRepository metadataRepo, CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, String instanceName, ParticipantStateTransitionStats threadPoolStats, HeartbeatMonitoringService heartbeatMonitoringService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Methods inherited from class org.apache.helix.participant.statemachine.StateModel
cancel, defaultTransitionHandler, getCurrentState, isCancelled, onBecomeErrorFromAny, syncState, updateState
-
Constructor Details
-
LeaderFollowerPartitionStateModel
public LeaderFollowerPartitionStateModel(IngestionBackend ingestionBackend, VeniceStoreVersionConfig storeAndServerConfigs, int partition, LeaderFollowerIngestionProgressNotifier notifier, ReadOnlyStoreRepository metadataRepo, CompletableFuture<HelixPartitionStatusAccessor> partitionPushStatusAccessorFuture, String instanceName, ParticipantStateTransitionStats threadPoolStats, HeartbeatMonitoringService heartbeatMonitoringService)
-
-
Method Details
-
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)
-