Uh oh!
There was an error while loading. Please reload this page.
HBASE-26163 Better logging in RSGroupInfoManagerImpl - #3610
Conversation
Apache-HBase
commented
Aug 20, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 20, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 20, 2021
🎊 +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.
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.
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()); |
| resetRSGroupMap(newGroupMap); | ||
| saveRSGroupMapToZK(newGroupMap); | ||
| updateCacheOfRSGroups(newGroupMap.keySet()); | ||
| LOG.info("Flush config done, new RSGroup map: {}", newGroupMap.toString()); |
| ProcedureSyncWait.waitForProcedureToCompleteIOE(masterServices.getMasterProcedureExecutor(), | ||
| proc, Long.MAX_VALUE); | ||
| } | ||
| LOG.info("Move tables done. Moved {} tables to {}: {}", tables.size(), targetGroup, |
caroliney14
commented
Aug 23, 2021
@Apache9 thanks for the review. I moved the lines you mentioned are too long to debug level logging instead. |
Apache-HBase
commented
Aug 23, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 23, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 23, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +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.
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
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 24, 2021
🎊 +1 overall
This message was automatically generated. |
caroliney14
commented
Aug 25, 2021
@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.
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.
Also here, I do not think we need to call toString explicitly...
caroliney14
commented
Aug 26, 2021
@Apache9 thanks, removed the |
Apache-HBase
commented
Aug 26, 2021
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 26, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 26, 2021
🎊 +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.
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?
| 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.
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.
Apache-HBase
commented
Aug 27, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 27, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 27, 2021
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 31, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 31, 2021
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Aug 31, 2021
💔 -1 overall
This message was automatically generated. |
caroliney14
commented
Aug 31, 2021
Apache-HBase
commented
Aug 31, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 1, 2021
💔 -1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 1, 2021
💔 -1 overall
This message was automatically generated. |
Apache9
commented
Sep 1, 2021
I'm OK with merging. Let's for one more day to see if @bharathv could come back and reply here. Thanks. |
Apache-HBase
commented
Sep 1, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 1, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 1, 2021
🎊 +1 overall
This message was automatically generated. |
caroliney14
commented
Sep 2, 2021
Apache-HBase
commented
Sep 2, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
Sep 2, 2021
🎊 +1 overall
This message was automatically generated. |
No description provided.