-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing Ambry partition state model and update Helix tool #1228
Conversation
1. Introduce new state model that incorporates BOOTSTRAP and INACTIVE states. 2. Add clustermap config that allows participant to choose which state model to use. Previous LeadStandby Model is default option. 3. Update Helix bootstrap tool to supporting specifying state model when creating new cluster or adding new state model to existing cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PROD looks good. Will look at test soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reset() method in the state model, probably you will need to implement in the future.
"no op" seems to be not right, just a reminder : )
|
||
|
||
@StateModelInfo(initialState = "OFFLINE", states = {"BOOTSTRAP", "LEADER", "STANDBY", "INACTIVE"}) | ||
public class AmbryPartitionStateModel extends StateModel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might need to override the following method:
@transition(to = "DROPPED", from = "ERROR")
public void onBecomeDroppedFromError(Message message, NotificationContext context)
throws Exception {
logger.info("Default ERROR->DROPPED transition invoked.");
}
Otherwise, the default clean up behavior won't do anything other than updating the state model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will add that method. Thanks for reminding me of this.
case AmbryStateModelDefinition.AMBRY_LEADER_STANDBY_MODEL: | ||
stateModelToReturn = new AmbryPartitionStateModel(); | ||
break; | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to explicitly check DEFAULT_STATE_MODEL_DEF here. For the other cases, shall throw an exception the earlier to better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will also add a test case for the change.
states.
model to use. Previous LeadStandby Model is default option.
creating new cluster or adding new state model to existing cluster.