BMM Restart Improvements Part 3. Leader polls for unclaimed tokens before declaring a datastream STOPPED#922
Merged
jzakaryan merged 10 commits intolinkedin:masterfrom Jan 24, 2023
Merged
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
vmaheshw
reviewed
Jan 23, 2023
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
shrinandthakkar
approved these changes
Jan 24, 2023
vmaheshw
approved these changes
Jan 24, 2023
| 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; |
Collaborator
There was a problem hiding this comment.
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; |
Collaborator
There was a problem hiding this comment.
@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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).