You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Stephen Yuan Jiang (JIRA)" <ji...@apache.org> on 2016/06/14 16:31:57 UTC
[jira] [Commented] (HBASE-8075) HRegion preClose hook is getting
called multiple times for single close
[ https://issues.apache.org/jira/browse/HBASE-8075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15329813#comment-15329813 ]
Stephen Yuan Jiang commented on HBASE-8075:
-------------------------------------------
I think we should at least remove the CP call in RSRpcServices#closeRegion() because it is redundant; the same function calls HRegionServer#closeRegion(), which will execute the preClose CP.
In RSRpcServices#closeRegion(), it calls RegionCoprocessorHost#preClose() first, then calls HRegionServer#closeRegion().
In HRegionServer#closeRegion(), the RegionCoprocessorHost#preClose() is called again.
{code}
@Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public CloseRegionResponse closeRegion(final RpcController controller,
final CloseRegionRequest request) throws ServiceException {
...
// Can be null if we're calling close on a region that's not online
final Region region = regionServer.getFromOnlineRegions(encodedRegionName);
if ((region != null) && (region .getCoprocessorHost() != null)) {
region.getCoprocessorHost().preClose(false);
}
...
boolean closed = regionServer.closeRegion(encodedRegionName, false, sn);
{code}
> HRegion preClose hook is getting called multiple times for single close
> -----------------------------------------------------------------------
>
> Key: HBASE-8075
> URL: https://issues.apache.org/jira/browse/HBASE-8075
> Project: HBase
> Issue Type: Bug
> Components: Coprocessors
> Affects Versions: 2.0.0, 1.3.0, 1.2.1, 1.1.4, 0.98.19
> Reporter: rajeshbabu
> Fix For: 2.0.0
>
>
> 1) HRegionServer#closeRegion(final RpcController controller,
> final CloseRegionRequest request)
> {code}
> // Can be null if we're calling close on a region that's not online
> final HRegion region = this.getFromOnlineRegions(encodedRegionName);
> if ((region != null) && (region .getCoprocessorHost() != null)) {
> region.getCoprocessorHost().preClose(false);
> }
> {code}
> 2) HRegionServer#closeRegion(String encodedName, final boolean abort,
> final boolean zk, final int versionOfClosingNode, final ServerName sn)
> {code}
> if ((actualRegion != null) && (actualRegion.getCoprocessorHost() != null)) {
> try {
> actualRegion.getCoprocessorHost().preClose(false);
> } catch (IOException exp) {
> LOG.warn("Unable to close region: the coprocessor launched an error ", exp);
> return false;
> }
> }
> {code}
> 3) HRegion# private List<StoreFile> doClose(
> final boolean abort, MonitoredTask status)
> {code}
> if (coprocessorHost != null) {
> status.setStatus("Running coprocessor pre-close hooks");
> this.coprocessorHost.preClose(abort);
> }
> {code}
> IMO 3rd one is enough and remaining two are not needed.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)