[ https://issues.apache.org/jira/browse/HBASE-10137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13846316#comment-13846316 ]
rajeshbabu commented on HBASE-10137: ------------------------------------ It also solves HBASE-6469. Currently any assignment failures in ETH leaving the table state in ENABLING state until we restart master. In the patch passing waitTillAllAssigned parameter as true to GeneralBulkAssigner means we will wait until all regions completely assigned. This is mandatory in ETH otherwise some regions may not be assigned. {code} BulkAssigner ba = new GeneralBulkAssigner(this.server, bulkPlan, this.assignmentManager, true); {code} In case of any failures retrying assignments and wait in GeneralBulkAssigner#waitUntilDone. {code} // We're not synchronizing on regionsInTransition now because we don't use any iterator. while (!regionSet.isEmpty() && !server.isStopped() && endTime > System.currentTimeMillis()) { Iterator<HRegionInfo> regionInfoIterator = regionSet.iterator(); while (regionInfoIterator.hasNext()) { HRegionInfo hri = regionInfoIterator.next(); if (regionStates.isRegionOnline(hri) || regionStates.isRegionInState(hri, State.SPLITTING, State.SPLIT, State.MERGING, State.MERGED)) { regionInfoIterator.remove(); } } if (!waitTillAllAssigned) { // No need to wait, let assignment going on asynchronously break; } if (!regionSet.isEmpty()) { regionStates.waitForUpdate(100); } } {code} But in case of BulkEnabler if region assignments take more time or failures we will timeout and leave the table state as ENABLING only. In disable table handler we are already retrying until all the regions completely closed. So there is no chance of table hang in DISABLING state case forever. > GeneralBulkAssigner with retain assignment plan can be used in > EnableTableHandler to bulk assign the regions > ------------------------------------------------------------------------------------------------------------ > > Key: HBASE-10137 > URL: https://issues.apache.org/jira/browse/HBASE-10137 > Project: HBase > Issue Type: Bug > Components: Region Assignment > Affects Versions: 0.96.0, 0.94.14 > Reporter: rajeshbabu > Assignee: rajeshbabu > Fix For: 0.98.0, 0.94.15, 0.96.2, 0.99.0 > > Attachments: HBASE-10137.patch > > > Current in BulkEnabler we are assigning one region at a time, instead we can > use GeneralBulkAssigner to bulk assign multiple regions at a time. > {code} > for (HRegionInfo region : regions) { > if (assignmentManager.getRegionStates() > .isRegionInTransition(region)) { > continue; > } > final HRegionInfo hri = region; > pool.execute(Trace.wrap("BulkEnabler.populatePool",new Runnable() { > public void run() { > assignmentManager.assign(hri, true); > } > })); > } > {code} -- This message was sent by Atlassian JIRA (v6.1.4#6159)