Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22460 : Reopen regions with very high Store Ref Counts#600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -135,6 +135,7 @@ | ||
| import org.apache.hadoop.hbase.master.procedure.ProcedurePrepareLatch; | ||
| import org.apache.hadoop.hbase.master.procedure.ProcedureSyncWait; | ||
| import org.apache.hadoop.hbase.master.procedure.RecoverMetaProcedure; | ||
| import org.apache.hadoop.hbase.master.procedure.ReopenTableRegionsProcedure; | ||
| import org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure; | ||
| import org.apache.hadoop.hbase.master.procedure.TruncateTableProcedure; | ||
| import org.apache.hadoop.hbase.master.replication.AbstractPeerProcedure; | ||
| @@ -420,6 +421,7 @@ public void run() { | ||
| // monitor for distributed procedures | ||
| private MasterProcedureManagerHost mpmHost; | ||
| private RegionsRecoveryChore regionsRecoveryChore = null; | ||
| // it is assigned after 'initialized' guard set to true, so should be volatile | ||
| private volatile MasterQuotaManager quotaManager; | ||
| private SpaceQuotaSnapshotNotifier spaceQuotaSnapshotNotifier; | ||
| @@ -1459,6 +1461,20 @@ private void startServiceThreads() throws IOException { | ||
| getMasterFileSystem().getFileSystem(), archiveDir, cleanerPool, params); | ||
| getChoreService().scheduleChore(hfileCleaner); | ||
| // Regions Reopen based on very high storeFileRefCount is considered enabled | ||
| // only if hbase.regions.recovery.store.file.ref.count has value > 0 | ||
| final int maxStoreFileRefCount = conf.getInt( | ||
| HConstants.STORE_FILE_REF_COUNT_THRESHOLD, | ||
| HConstants.DEFAULT_STORE_FILE_REF_COUNT_THRESHOLD); | ||
| if (maxStoreFileRefCount > 0) { | ||
| this.regionsRecoveryChore = new RegionsRecoveryChore(this, conf, this); | ||
| getChoreService().scheduleChore(this.regionsRecoveryChore); | ||
| } else { | ||
| LOG.info("Reopening regions with very high storeFileRefCount is disabled. " + | ||
| "Provide threshold value > 0 for {} to enable it.", | ||
| HConstants.STORE_FILE_REF_COUNT_THRESHOLD); | ||
| } | ||
| replicationBarrierCleaner = new ReplicationBarrierCleaner(conf, this, getConnection(), | ||
| replicationPeerManager); | ||
| getChoreService().scheduleChore(replicationBarrierCleaner); | ||
| @@ -1626,6 +1642,7 @@ private void stopChores() { | ||
| choreService.cancelChore(this.replicationBarrierCleaner); | ||
| choreService.cancelChore(this.snapshotCleanerChore); | ||
| choreService.cancelChore(this.hbckChore); | ||
| choreService.cancelChore(this.regionsRecoveryChore); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the chore was not scheduled, this cancel call wont make any issue right? Just confirming ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it won't make any issues, I confirmed it | ||
| } | ||
| } | ||
| @@ -3727,6 +3744,38 @@ public void remoteProcedureFailed(long procId, RemoteProcedureException error) { | ||
| } | ||
| } | ||
| /** | ||
| * Reopen regions provided in the argument | ||
| * | ||
| * @param tableName The current table name | ||
| * @param regionNames The region names of the regions to reopen | ||
| * @param nonceGroup Identifier for the source of the request, a client or process | ||
| * @param nonce A unique identifier for this operation from the client or process identified by | ||
| * <code>nonceGroup</code> (the source must ensure each operation gets a unique id). | ||
| * @return procedure Id | ||
| * @throws IOException if reopening region fails while running procedure | ||
| */ | ||
| long reopenRegions(final TableName tableName, final List<byte[]> regionNames, | ||
| final long nonceGroup, final long nonce) | ||
| throws IOException { | ||
| return MasterProcedureUtil | ||
| .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) { | ||
| @Override | ||
| protected void run() throws IOException { | ||
| submitProcedure(new ReopenTableRegionsProcedure(tableName, regionNames)); | ||
| } | ||
| @Override | ||
| protected String getDescription() { | ||
| return "ReopenTableRegionsProcedure"; | ||
| } | ||
| }); | ||
| } | ||
| @Override | ||
| public ReplicationPeerManager getReplicationPeerManager() { | ||
| return replicationPeerManager; | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should allow users to change this with out restarting the HM. But on a followup issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean similar to _switch command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.. Via ConfigurationObserver way and allow changes to be impacted with out restart of process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, looking forward to it on follow up Jira