-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-22460 : Reopen regions with very high Store Ref Counts #600
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
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 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; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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