Skip to content
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

BMM Restart Improvements Part 2. Followers claim their tokens after handling stop assignments #921

Merged
merged 14 commits into from
Jan 23, 2023

Conversation

jzakaryan
Copy link
Collaborator

This pull request is part of a series of changes that are meant to improve BMM Restart and make it easier to debug restart failures and trace them to the faulty hosts. Part 2 includes changes to the follower's code to make them claim assignment tokens for the datastreams that have been successfully stopped. It also includes the following improvements that were suggested in #919:

  • AssignmentToken class was made immutable thanks to @ehoner pointing out the JSON library APIs.
  • Tokens now carry instance names of issuing host instead of the host name. There's a slight semantic distinction between a host name and a live instance name and the latter is more useful. This was a suggestion by @vmaheshw.

The PRs in this series deal with the following aspects:
Part 1 – Introduction of assignment tokens and support for issuing tokens by the leader coordinator (#919)
Part 2 – Changes to the followers' handleAssignmentChange to make them claim the tokens issued by the leader.
Part 3 – Changes to the leader to make it poll the ZooKeeper and wait for the assignment change (stop) to be propagated and executed by the cluster. This will also include code for handling assignment failures and signals to the client that problem(s) occurred in the form of log messages and a new metric.
Part 4 – This one will deal with edge cases and cleanup. More specifically, what happens when a leader fails over during an assignment (assignment token nodes are persistent and their lifecycle is tied to that of the parent datastream).

Copy link
Collaborator

@vmaheshw vmaheshw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brooklin does not maintain the latest datastream cache and does not listen to incremental updates. So, this PR may not work. Please recheck if your tests contains multiple instances and the follower only instance is able to claim the token.

Copy link
Collaborator

@shrinandthakkar shrinandthakkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall code flow LGTM, just a couple of comments.

@@ -360,6 +366,14 @@ public void stop() {
}
}

// Shutdown executor services
if (_scheduledExecutor != null) {
_scheduledExecutor.shutdown();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm calling the more graceful shutdown path here. No new submissions will be accepted but the tasks that have already been submitted will be lingering until completion. I could block and wait for all tasks to complete here. I could also force terminate everything (which is a best effort operation). I don't think more oppressive measures are required here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants