[ 
https://issues.apache.org/jira/browse/HBASE-20111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415886#comment-16415886
 ] 

Josh Elser commented on HBASE-20111:
------------------------------------

{quote}{{checkSplit}} already has check w.r.t. system tables:
{quote}
I think I'd disagree with you, although I see what lead you to this opinion. I 
read this code as the intent of {{splittable}} is more about overt details of 
this region which are not tied to the lifecycle of this region: e.g. split 
policy, not a 'special' system table. {{checkSplit}} more encapsulates logic 
about whether we can (right now) split the region.
{quote}It seems {{shouldSplit}} should take into account the value of 
{{bestSplitRow}} - if {{bestSplitRow}} is null, {{shouldSplit}} should be false.
{quote}
This is handled in the Master which I think is the right place for it to 
happen. You're right that if this RPC would return that the region is 
splittable, the user did not provide a row to split upon, and the region could 
not provide a row to split upon, that should be an assertion failure.
{code:java}
    if (node != null) {
      try {
        if (bestSplitRow == null || bestSplitRow.length == 0) {
          LOG.info("splitKey isn't explicitly specified, " + " will try to find 
a best split key from RS");
        }
        // Always set bestSplitRow request as true here,
        // need to call Region#checkSplit to check it splittable or not
        GetRegionInfoResponse response =
            Util.getRegionInfoResponse(env, node.getRegionLocation(), 
node.getRegionInfo(), true);
        if(bestSplitRow == null || bestSplitRow.length == 0) {
          bestSplitRow = response.hasBestSplitRow() ? 
response.getBestSplitRow().toByteArray() : null;
        }
        splittable = response.hasSplittable() && response.getSplittable();

        if (LOG.isDebugEnabled()) {
          LOG.debug("Splittable=" + splittable + " " + node.toShortString());
        }
      } catch (IOException e) {
        splittableCheckIOE = e;
      }
    }

    if (!splittable) {
      IOException e = new 
DoNotRetryIOException(regionToSplit.getShortNameToLog() + " NOT splittable");
      if (splittableCheckIOE != null) e.initCause(splittableCheckIOE);
      throw e;
    }
    if(bestSplitRow == null || bestSplitRow.length == 0) {
      throw new DoNotRetryIOException("Region not splittable because 
bestSplitPoint = null, "
          + "maybe table is too small for auto split. For force split, try 
specifying split row");
    }{code}
IMO, what we have already covers this pretty well since the SplitTableProcedure 
could still proceed with a user-provided split key if the Region could not 
compute one for some reason.

That said, the {{isClosing()}} check done in {{HRegion.checkSplit()}} does 
sound like it should be lifted out of this method and set explicitly on 
{{isSplittable}}..

> Able to split region explicitly even on shouldSplit return false from split 
> policy
> ----------------------------------------------------------------------------------
>
>                 Key: HBASE-20111
>                 URL: https://issues.apache.org/jira/browse/HBASE-20111
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Critical
>             Fix For: 2.0.0
>
>         Attachments: HBASE-20111.001.branch-2.0.patch, HBASE-20111.patch, 
> HBASE-20111_test.patch, HBASE-20111_v2.patch, HBASE-20111_v3.patch
>
>
> Currently able to split the region explicitly even when the split policy 
> returns from shouldSplit.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to