-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26163 Better logging in RSGroupInfoManagerImpl #3610
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. |
| if (!fallbackRegions.isEmpty()) { | ||
| List<ServerName> candidates = null; | ||
| if (isFallbackEnabled()) { | ||
| LOG.debug("Falling back {} regions to servers outside their RSGroup. Regions: {}", |
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.
Better wrap it with a LOG.isDebugEnabled? We have a stream operation when constructing the parameter.
| LOG.info("Updated default servers, {} servers", newDefaultGroupInfo.getServers().size()); | ||
| LOG.info("Updated default servers, now {} servers online: {}", | ||
| newDefaultGroupInfo.getServers().size(), | ||
| newDefaultGroupInfo.getServers().stream().map(Address::toString).collect(Collectors.toSet())); |
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 the message will be too long if we log the servers? This is a log in info level, not debug.
| // according to the inputted newGroupMap (an updated copy of rsGroupMap) | ||
| this.holder = new RSGroupInfoHolder(newGroupMap); | ||
|
|
||
| LOG.info("New RSGroup map: {}", newGroupMap.toString()); |
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.
Maybe too much for info?
| resetRSGroupMap(newGroupMap); | ||
| saveRSGroupMapToZK(newGroupMap); | ||
| updateCacheOfRSGroups(newGroupMap.keySet()); | ||
| LOG.info("Flush config done, new RSGroup map: {}", newGroupMap.toString()); |
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.
Ditto.
| ProcedureSyncWait.waitForProcedureToCompleteIOE(masterServices.getMasterProcedureExecutor(), | ||
| proc, Long.MAX_VALUE); | ||
| } | ||
| LOG.info("Move tables done. Moved {} tables to {}: {}", tables.size(), targetGroup, |
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.
Ditto.
|
@Apache9 thanks for the review. I moved the lines you mentioned are too long to debug level logging instead. |
|
🎊 +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. |
| // according to the inputted newGroupMap (an updated copy of rsGroupMap) | ||
| this.holder = new RSGroupInfoHolder(newGroupMap); | ||
|
|
||
| LOG.debug("New RSGroup map: {}", newGroupMap.toString()); |
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.
Its not a good idea to call toString() on the parameter as that defeats the purpose of parameterized logging, if DEBUG is not enabled. toString() is implicitly evaluated by log4j only if DEBUG logging is enabled for this class. Please get rid of toString() here and below.
https://www.javacodegeeks.com/2015/10/better-performing-non-logging-logger-calls-in-log4j2.html
|
🎊 +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. |
|
@Apache9 if no more comments, are we good to merge this one? |
| proc, Long.MAX_VALUE); | ||
| } | ||
| LOG.info("Move tables done. Moved {} tables to {}: {}", tables.size(), targetGroup, | ||
| tables.stream().map(TableName::getNameAsString).collect(Collectors.toSet())); |
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 tableName.toString is the same with getNameAsString? So we do not need to generate a new String set?
| LOG.info("Move servers done: {} => {}", srcGrp.getName(), targetGroupName); | ||
| LOG.info("Move servers done. Moved {} servers {} => {}: {}", movedServers.size(), | ||
| srcGrp.getName(), targetGroupName, | ||
| movedServers.stream().map(Address::toString).collect(Collectors.toSet())); |
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.
Also here, I do not think we need to call toString explicitly...
|
@Apache9 thanks, removed the |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| ProcedureSyncWait.waitForProcedureToCompleteIOE(masterServices.getMasterProcedureExecutor(), | ||
| proc, Long.MAX_VALUE); | ||
| } | ||
| LOG.info("Move tables done. Moved {} tables to {}: {}", tables.size(), targetGroup, tables); |
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.
We will log too much if the level is info here? Can we just info the size and the target group, and add another debug log to log all the tables?
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.
done
| targetGroupName); | ||
| moveServerRegionsFromGroup(movedServers, srcGrp.getServers(), targetGroupName, srcGrp.getName()); | ||
| LOG.info("Move servers done: {} => {}", srcGrp.getName(), targetGroupName); | ||
| LOG.info("Move servers done. Moved {} servers from {} => {}: {}", movedServers.size(), |
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.
Ditto, I'm afraid it will too much to also log all the servers name, but log the size in info and then all the servers with debug.
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.
done
|
🎊 +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. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
I'm OK with merging. Let's for one more day to see if @bharathv could come back and reply here. Thanks. |
|
🎊 +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. |
No description provided.