-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-24620 : Add a ClusterManager which submits command to ZooKeeper and its Agent which picks and execute those Commands. #2299
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
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
@lokiore - Tests failures doesn't look related but still good to confirm if these tests fail in local as well without this patch. |
|
Let me re-build. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@lokiore Can you also add your design doc under |
@virajjasani I have added Design Doc as PDF as requested. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
virajjasani
left a comment
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.
Left some comments. Nice work overall !
bin/chaos-daemon.sh
Outdated
|
|
||
| # if no args specified, show usage | ||
| if [ $# -le 1 ]; then | ||
| echo $usage |
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: echo "$usage"?
| check_before_start(){ | ||
| #ckeck if the process is not running | ||
| mkdir -p "$HBASE_PID_DIR" | ||
| if [ -f $CHAOS_PID ]; then | ||
| if kill -0 `cat $CHAOS_PID` > /dev/null 2>&1; then | ||
| echo $command running as process `cat $CHAOS_PID`. Stop it first. | ||
| exit 1 | ||
| fi | ||
| fi | ||
| } |
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: will this work?
check_before_start(){
#ckeck if the process is not running
mkdir -p "$HBASE_PID_DIR"
if [ -f "$CHAOS_PID" ]; then
if kill -0 "$(cat "$CHAOS_PID")" > /dev/null 2>&1; then
echo "$command" running as process "$(cat "$CHAOS_PID")". Stop it first.
exit 1
fi
fi
}
bin/chaos-daemon.sh
Outdated
| } | ||
|
|
||
| bin=`dirname "${BASH_SOURCE-$0}"` | ||
| bin=`cd "$bin">/dev/null; pwd` |
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: bin=$(cd "$bin">/dev/null || exit; pwd)
|
|
||
| /*** | ||
| * An agent for executing destructive actions for ChaosMonkey. | ||
| * Uses ZooKeeper Watchersc and LocalShell, to do the killing |
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: Watchers ?
| @InterfaceAudience.Private | ||
| public class ChaosAgent implements Watcher, Closeable, Runnable { | ||
|
|
||
| private static final Logger LOG = LoggerFactory.getLogger(ChaosAgent.class.getName()); |
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: LoggerFactory.getLogger(ChaosAgent.class) should be enough.
| try { | ||
| createNewZKConnection(); | ||
| } catch (IOException e) { | ||
| LOG.error("Error creating new ZK COnnection for agent: " + e); |
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.
same as others: log should have Exception as arg
| try { | ||
| zk.close(); | ||
| } catch (InterruptedException e) { | ||
| LOG.error("Error closing ZK connection : " + e); |
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.
same as others: log should have Exception as arg
| } | ||
| }; | ||
|
|
||
| AsyncCallback.StatCallback setStatusWatchCallback = new AsyncCallback.StatCallback() { |
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: use lambda similar to setStatusOfTaskZNodeCallback?
| } | ||
| }; | ||
|
|
||
| AsyncCallback.StringCallback submitTaskCallback = new AsyncCallback.StringCallback() { |
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: use lambda similar to setStatusOfTaskZNodeCallback?
| try { | ||
| this.createNewZKConnection(); | ||
| } catch (IOException e) { | ||
| LOG.error("Error creating ZooKeeper Connection: " + e); |
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.
Exception as last argument
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
virajjasani
left a comment
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.
+1, left one comment, rest can be addressed separately. Thanks @lokiore
| Thread t = new Thread(new ChaosAgent(conf, | ||
| ChaosUtils.getZKQuorum(conf), ChaosUtils.getHostName())); | ||
| t.start(); | ||
| t.join(); |
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.
Sure, this can be follow up.
| List<Thread> tasksList = new ArrayList<>(); | ||
| for (String task : children) { | ||
| String threadName = agentName + "_" + task; | ||
| Thread t = new Thread(() -> { |
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.
This can also be follow up.
| assert (ChaosConstants.CHAOS_AGENT_STATUS_PERSISTENT_ZNODE + | ||
| ChaosConstants.ZNODE_PATH_SEPARATOR + agentName).equals(watchedEvent.getPath()); |
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.
@lokiore I this here we can provide better Exception than assert. Something like:
if (!(ChaosConstants.CHAOS_AGENT_STATUS_PERSISTENT_ZNODE +
ChaosConstants.ZNODE_PATH_SEPARATOR + agentName).equals(watchedEvent.getPath()) {
throw new RuntimeException(xxx); // or something better
}
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
… and its Agent which picks and execute those Commands (#2299) Signed-off-by: Aman Poonia <apoonia@salesforce.com> Signed-off-by: Viraj Jasani <vjasani@apache.org>
… and its Agent which picks and execute those Commands (#2299) Signed-off-by: Aman Poonia <apoonia@salesforce.com> Signed-off-by: Viraj Jasani <vjasani@apache.org>
… and its Agent which picks and execute those Commands (#2299) Signed-off-by: Aman Poonia <apoonia@salesforce.com> Signed-off-by: Viraj Jasani <vjasani@apache.org>
… and its Agent which picks and execute those Commands (#2299) Co-authored-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Aman Poonia <apoonia@salesforce.com> Signed-off-by: Viraj Jasani <vjasani@apache.org>
No description provided.