-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-26614 Refactor code related to "dump"ing ZK nodes #3969
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We crash errorprone? 😭 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Is the replication unit result in the precommit a repeatable failure? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Of course, after I went through the new ZKDump class, I realized that this was all copy-paste :). Leaving the comments as-is, but I'm not concerned about them.
Are there any shell scripts which might have called the old dump()
static method you removed? Is it possible to deprecate the old method and have it just call the new location of the utility in the ZKDump
class instead?
return connect(conf, ensemble, watcher); | ||
} | ||
|
||
public static RecoverableZooKeeper connect(Configuration conf, String ensemble, |
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.
Would be nice to have Javadoc on all of the connect
public methods in this class, but just a nit since this is @private
try { | ||
sb.append("\n ").append(MasterAddressTracker.getMasterAddress(zkWatcher)); | ||
} catch (IOException e) { | ||
sb.append("<<FAILED LOOKUP: ").append(e.getMessage()).append(">>"); |
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.
"FAILED MASTER LOOKUP"? Something to indicate what we were trying to do which failed?
for (String child : backupMasterChildrenNoWatchList) { | ||
sb.append("\n ").append(child); | ||
} | ||
} |
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.
An else
to indicate that we found no backups (or you think not printing anythign is sufficient?)
} | ||
} | ||
try { | ||
getReplicationZnodesDump(zkWatcher, sb); |
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.
Would recommend printing some header here like for the other sections.
* @return The array of response strings. | ||
* @throws IOException When the socket communication fails. | ||
*/ | ||
private static String[] getServerStats(String server, int timeout) |
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: getZkServerStats
} | ||
} | ||
for (String zNodeChild : ZKUtil.listChildrenNoWatch(zkw, znodeToProcess)) { | ||
stack.add(ZNodePaths.joinZNode(znodeToProcess, zNodeChild)); |
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 think you want to insert these at the front of the list rather than append them to the rest, otherwise you would be doing a depth-first traversal but over the reverse-sorted order of the children of znodeToProcess
(if I remember correctly that listChildrenNoWatch
will return the children in sorter order).
Oh, nice thinking. Yeah, looks like
sorry for the edits
I could, but why? You want to protect users who are calling into an IA.Private class? |
f010576
to
2aee01c
Compare
I don't think so but I don't have logs from the failed test runs. Let's see if it's still there for the next one. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this error prone failure is not related to my change. Mike is working on a fix/upgrade over on #3979 |
This comment has been minimized.
This comment has been minimized.
It is related. You call MetaTableLocator.getMetaRegionLocation in ZKDump but the method has a RestrictedApi annotation which only allow calling from ZKUtil and tests code. Since you just move some code in ZKUtil out to a separated class, you need to change the RestrictedApi annotation in MetaTableLocator. Thanks. |
2aee01c
to
ecb0471
Compare
This comment has been minimized.
This comment has been minimized.
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.
The error prone failure is related. Please fix it before merging. Use a 'request changes' to make it more clear since there are already too many comments.
Thanks for the mention @Apache9 . I did miss your earlier comment. You are correct in that my patch introduces an ErrorProne violation according to the annotation that you point how. However, I didn't know this because the use of that annotation in our code is not compatible with the version of ErrorProne run by Yetus on pre-commit. I think Mike's patch that upgrades ErrorProne will fix this, but I'll need to do some testing to be sure. In the mean time, let me progress on this ticket. |
ecb0471
to
16ad718
Compare
This comment has been minimized.
This comment has been minimized.
@joshelser do you mind if we address your code comments in a subsequent change? I'd like to keep this one isolated to the relocations only, as much as possible. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Unit test failure looks like HBASE-26651. |
The code starting at `ZKUtil.dump(ZKWatcher)` is a small mess – it has cyclic dependencies woven through itself, `ZKWatcher` and `RecoverableZooKeeper`. It also initializes a static variable in `ZKUtil` through the factory for `RecoverableZooKeeper` instances. Let's decouple and clean it up.
16ad718
to
028f5b3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Argh. Build 9 Jdk11/Hadoop3 failed due to |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
The code starting at `ZKUtil.dump(ZKWatcher)` is a small mess – it has cyclic dependencies woven through itself, `ZKWatcher` and `RecoverableZooKeeper`. It also initializes a static variable in `ZKUtil` through the factory for `RecoverableZooKeeper` instances. Let's decouple and clean it up. Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
The code starting at `ZKUtil.dump(ZKWatcher)` is a small mess – it has cyclic dependencies woven through itself, `ZKWatcher` and `RecoverableZooKeeper`. It also initializes a static variable in `ZKUtil` through the factory for `RecoverableZooKeeper` instances. Let's decouple and clean it up. Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
The code starting at `ZKUtil.dump(ZKWatcher)` is a small mess – it has cyclic dependencies woven through itself, `ZKWatcher` and `RecoverableZooKeeper`. It also initializes a static variable in `ZKUtil` through the factory for `RecoverableZooKeeper` instances. Let's decouple and clean it up. Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
The code starting at `ZKUtil.dump(ZKWatcher)` is a small mess – it has cyclic dependencies woven through itself, `ZKWatcher` and `RecoverableZooKeeper`. It also initializes a static variable in `ZKUtil` through the factory for `RecoverableZooKeeper` instances. Let's decouple and clean it up. Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Josh Elser <elserj@apache.org>
The code starting at
ZKUtil.dump(ZKWatcher)
is a small mess – it has cyclic dependencies woventhrough itself,
ZKWatcher
andRecoverableZooKeeper
. It also initializes a static variable inZKUtil
through the factory forRecoverableZooKeeper
instances. Let's decouple and clean itup.