BMM Restart Improvements Part 1. Leader Coordinator Issuing Assignment Tokens#919
Merged
BMM Restart Improvements Part 1. Leader Coordinator Issuing Assignment Tokens#919
Conversation
vmaheshw
reviewed
Dec 8, 2022
datastream-server/src/main/java/com/linkedin/datastream/server/AssignmentToken.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/AssignmentToken.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/AssignmentToken.java
Show resolved
Hide resolved
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/zk/ZkAdapter.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Show resolved
Hide resolved
ehoner
reviewed
Dec 8, 2022
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/zk/ZkAdapter.java
Outdated
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Show resolved
Hide resolved
hshukla
reviewed
Dec 9, 2022
datastream-server/src/main/java/com/linkedin/datastream/server/zk/KeyBuilder.java
Show resolved
Hide resolved
datastream-server/src/main/java/com/linkedin/datastream/server/AssignmentToken.java
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/zk/ZkAdapter.java
Show resolved
Hide resolved
datastream-server/src/test/java/com/linkedin/datastream/server/zk/TestZkAdapter.java
Show resolved
Hide resolved
hshukla
reviewed
Dec 9, 2022
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Outdated
Show resolved
Hide resolved
…/zk/ZkAdapter.java Co-authored-by: Harshil Shukla <harshiljshukla@gmail.com>
ehoner
approved these changes
Dec 13, 2022
Contributor
ehoner
left a comment
There was a problem hiding this comment.
I can approve again if you want to change the json serialization.
Comment on lines
+71
to
+90
| /** | ||
| * Sets the name of the leader host that issued the token | ||
| */ | ||
| public void setIssuedBy(String issuedBy) { | ||
| _issuedBy = issuedBy; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the name of the host for which the token was issued | ||
| */ | ||
| public void setIssuedFor(String issuedFor) { | ||
| _issuedFor = issuedFor; | ||
| } | ||
|
|
||
| /** | ||
| * Sets the timestamp (in UNIX epoch format) for when the token was issued | ||
| */ | ||
| public void setTimestamp(long timestamp) { | ||
| _timestamp = timestamp; | ||
| } |
Contributor
There was a problem hiding this comment.
Are these setters necessary?
If not.
Can they be removed? (Disregard if they are planned for future use in the future parts.)
If they can be removed.
This object would be immutable, would it be better to remove get from the field accessors? (If the get prefix is a sensitive topic disregard.)
Contributor
There was a problem hiding this comment.
fwiw. annotations similar to below would be required.
public class Demo {
private final String name;
private final Integer age;
@JsonCreator
Demo(@JsonProperty("name") String name, @JsonProperty("age") Integer age) {
this.name = name;
this.age = age;
}
@JsonGetter("name")
public String name() {
return name;
}
@JsonGetter("age")
public Integer age() {
return age;
}
}
Collaborator
Author
There was a problem hiding this comment.
Thanks for sharing the API usage example. With the next set of changes I'll change my JSON class to make use of these and keep the class otherwise immutable.
datastream-server/src/main/java/com/linkedin/datastream/server/zk/ZkAdapter.java
Outdated
Show resolved
Hide resolved
shrinandthakkar
approved these changes
Dec 14, 2022
Merged
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. It introduces the concept of assignment tokens and adds support for issuing those tokens by the leader coordinator. This feature can be toggled by the newly introduced
brooklin.server.coordinator.enableAssignmentTokensconfiguration.The subsequent PRs will deal with the following aspects:
Part 2 – Changes to the followers'
onAssignmentChangeto 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).