[
https://issues.apache.org/jira/browse/HBASE-8075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599961#comment-13599961
]
rajeshbabu commented on HBASE-8075:
-----------------------------------
@Ram,
May be we can rename the hook names to make it more clear. What do you think?
Yes. Its better to have different names for each hook,other wise same
implementation of a coprocessor hook will be called multiple times and can
cause inconsistencies.
> 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: 0.94.0
> Reporter: rajeshbabu
> Assignee: rajeshbabu
> Fix For: 0.98.0, 0.94.7
>
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira