-
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-27859:HMaster.getCompactionState can happen NPE when region state is closed #5232
Conversation
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Outdated
Show resolved
Hide resolved
💔 -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. |
@@ -4155,6 +4155,11 @@ public CompactionState getCompactionState(final TableName tableName) { | |||
continue; | |||
} | |||
RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName()); | |||
if (regionMetrics == null) { | |||
LOG.error("Can not get compaction details for the region: " | |||
+ regionInfo.getRegionNameAsString() + " , it may be not online."); |
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.
Please use parameterised logging.
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 the review. The update has been made.
At the same time , I changed the log level to WARN, as it more suitable here, I think.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -4155,6 +4155,12 @@ public CompactionState getCompactionState(final TableName tableName) { | |||
continue; | |||
} | |||
RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName()); | |||
if (regionMetrics == null) { | |||
LOG.warn(String.format( | |||
"Can not get compaction details for the region: %s , it may be not online.", |
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.
log4j already has the parameterised feature, there's no need to use String.format
here. Just do:
LOG.warn("Can not get compaction details for the region: {} , it may be not online.", regionInfo.getRegionNameAsString());
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 update has been made, 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. |
💔 -1 overall
This message was automatically generated. |
…te is closed (apache#5232) Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> (cherry picked from commit b2e2abe) (cherry picked from commit d8b9d82) Change-Id: Iae2d47e8dbf1fd32bdd8d64ad784e6844cb4b8b7
Details see : HBASE-27859