-
Notifications
You must be signed in to change notification settings - Fork 138
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
Conversation
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.
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.
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
...connector/src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaConnector.java
Show resolved
Hide resolved
...connector/src/main/java/com/linkedin/datastream/connectors/kafka/AbstractKafkaConnector.java
Show resolved
Hide resolved
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.
The overall code flow LGTM, just a couple of comments.
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server-api/src/main/java/com/linkedin/datastream/server/api/connector/Connector.java
Outdated
Show resolved
Hide resolved
datastream-server-restli/src/test/java/com/linkedin/datastream/server/TestCoordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Outdated
Show resolved
Hide resolved
@@ -360,6 +366,14 @@ public void stop() { | |||
} | |||
} | |||
|
|||
// Shutdown executor services | |||
if (_scheduledExecutor != null) { | |||
_scheduledExecutor.shutdown(); |
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'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.
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.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).