[
https://issues.apache.org/jira/browse/HBASE-5927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276579#comment-13276579
]
chunhui shen commented on HBASE-5927:
-------------------------------------
@Rajesh
bq.HBASE-5914 causing assignment of disabling/ disabled table regions. Avoided
by removing regioninfo from toAssignRegions list if disable is happening to a
table.
I think it's not right.
1.ServerShutdownHandler#processDeadRegion will return false if the table is
disabled , so we wouldn't add the region to toAssignRegions in the process of
ServerShutdownHandler.
2.For the disabling table regions, ServerShutdownHandler will assign it with
HBASE-5914, however, OpenedRegionHandler will unassign it again after it is
opened.
However, we found SSH and DisableTableHandler happening together may cause
HBASE-6012.
Could we make a new method which cancel closing if region belongs to disabling ?
So we could fix the issue as the following
{code}
if (!regions.containsKey(region)) {
LOG.debug("Attempted to unassign region " +
region.getRegionNameAsString() + " but it is not " +
"currently assigned anywhere");
cancelClosingRegionIfDisabling(region)
return;
}
....
if (t instanceof NotServingRegionException) {
cancelClosingRegionIfDisabling(region)
}
...
private void cancelClosingRegionIfDisabling(HRegionInfo region) {
if (checkIfRegionBelongsToDisabling(region)) {
// Remove from the regionsinTransition map
LOG.info("While trying to recover the table "
+ region.getTableNameAsString()
+ " to DISABLED state the region " + region
+ " was offlined but the table was in DISABLING state");
synchronized (this.regionsInTransition) {
this.regionsInTransition.remove(region.getEncodedName());
}
// Remove from the regionsMap
synchronized (this.regions) {
this.regions.remove(region);
Set<HRegionInfo> serverRegions = this.servers.get(server);
if (!serverRegions.remove(region)) {
LOG.warn("No " + region + " on " + server);
}
}
deleteClosingOrClosedNode(region);
}
}
{code}
Correct me if wrong, thanks!
> SSH and DisableTableHandler happening together does not clear the znode of
> the region and RIT map.
> --------------------------------------------------------------------------------------------------
>
> Key: HBASE-5927
> URL: https://issues.apache.org/jira/browse/HBASE-5927
> Project: HBase
> Issue Type: Bug
> Components: master
> Affects Versions: 0.92.1, 0.96.0, 0.94.1
> Reporter: Jieshan Bean
> Assignee: Jieshan Bean
> Fix For: 0.92.2, 0.96.0, 0.94.1
>
> Attachments: HBASE-5927_94.patch, HBASE-5927_94_v2.patch,
> HBASE-5927_trunk.patch, HBASE-5927_trunk_2.patch, TestCaseForReProduce.txt
>
>
> A possible exception: If the related regionserver was just killed(But HMaster
> has not perceived that), then we will get a local exception "Connection reset
> by peer". If this region belongs to a disabling table. what will happen?
> ServerShutdownHandler will remove this region from AM#regions. So this region
> is still existing in RIT. TimeoutMonitor will take care of it after it got
> timeout. Then invoke unassign again. Since this region has been removed from
> AM#regions, it will return directly due to the below code:
> {code}
> synchronized (this.regions) {
> // Check if this region is currently assigned
> if (!regions.containsKey(region)) {
> LOG.debug("Attempted to unassign region " +
> region.getRegionNameAsString() + " but it is not " +
> "currently assigned anywhere");
> return;
> }
> }
> {code}
> Then it leads to an end-less loop.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira