-
Notifications
You must be signed in to change notification settings - Fork 135
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 3. Leader polls for unclaimed tokens before declaring a datastream STOPPED #922
Conversation
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
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
Outdated
Show resolved
Hide resolved
public static final String CONFIG_TASK_STOP_CHECK_RETRY_PERIOD_MS = PREFIX + "taskStopCheckRetryPeriodMs"; | ||
|
||
public static final int DEFAULT_MAX_ASSIGNMENT_RETRY_COUNT = 100; | ||
public static final long DEFAULT_STOP_PROPAGATION_TIMEOUT_MS = 60000; |
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.
nit: 60000 to 60 * 1000 (simiar to others)
datastream-server/src/main/java/com/linkedin/datastream/server/Coordinator.java
Show resolved
Hide resolved
datastream.setStatus(DatastreamStatus.STOPPED); | ||
if (!_adapter.updateDatastream(datastream)) { | ||
_log.warn("Failed to update datastream: {} to stopped state", datastream.getName()); | ||
succeeded = false; |
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.
@shrinandthakkar Can you double check that the recent issue that you saw with the previous assignment getting replaced by new assignment and some cleanup is not completed, will not reoccur in this scenario?
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 3 introduces changes to the leader that make it poll the tokens for stop assignment and make sure that all followers claimed their tokens before declaring a stream
STOPPED
. If at least one follower failed to claim their token, a detailed error message is logged and a metric is emitted. Unclaimed tokens are revoked by the leader. Poll timeout is configurable.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. (#921)
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.
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).