-
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 1. Leader Coordinator Issuing Assignment Tokens #919
Conversation
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
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
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
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>
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 can approve again if you want to change the json serialization.
/** | ||
* 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; | ||
} |
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.
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.)
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.
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;
}
}
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.
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.
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.enableAssignmentTokens
configuration.The subsequent PRs will deal with the following aspects:
Part 2 – Changes to the followers'
onAssignmentChange
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).