use of org.apache.hadoop.hbase.master.MasterWalManager in project hbase by apache.
the class ServerCrashProcedure method prepareLogReplay.
private void prepareLogReplay(final MasterProcedureEnv env, final Set<HRegionInfo> regions) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Mark " + size(this.regionsOnCrashedServer) + " regions-in-recovery from " + this.serverName);
}
MasterWalManager mwm = env.getMasterServices().getMasterWalManager();
AssignmentManager am = env.getMasterServices().getAssignmentManager();
mwm.prepareLogReplay(this.serverName, regions);
am.getRegionStates().logSplit(this.serverName);
}
use of org.apache.hadoop.hbase.master.MasterWalManager in project hbase by apache.
the class ServerCrashProcedure method start.
/**
* Start processing of crashed server. In here we'll just set configs. and return.
* @param env
* @throws IOException
*/
private void start(final MasterProcedureEnv env) throws IOException {
MasterWalManager mwm = env.getMasterServices().getMasterWalManager();
// Set recovery mode late. This is what the old ServerShutdownHandler used do.
mwm.setLogRecoveryMode();
this.distributedLogReplay = mwm.getLogRecoveryMode() == RecoveryMode.LOG_REPLAY;
}
use of org.apache.hadoop.hbase.master.MasterWalManager in project hbase by apache.
the class ServerCrashProcedure method zkCoordinatedSplitLogs.
/**
* Split logs using 'classic' zk-based coordination.
* Superceded by procedure-based WAL splitting.
* @see #createSplittingWalProcedures(MasterProcedureEnv, boolean)
*/
private void zkCoordinatedSplitLogs(final MasterProcedureEnv env) throws IOException {
LOG.debug("Splitting WALs {}", this);
MasterWalManager mwm = env.getMasterServices().getMasterWalManager();
AssignmentManager am = env.getMasterServices().getAssignmentManager();
// TODO: For Matteo. Below BLOCKs!!!! Redo so can relinquish executor while it is running.
// PROBLEM!!! WE BLOCK HERE. Can block for hours if hundreds of WALs to split and hundreds
// of SCPs running because big cluster crashed down.
am.getRegionStates().logSplitting(this.serverName);
mwm.splitLog(this.serverName);
if (!carryingMeta) {
mwm.archiveMetaLog(this.serverName);
}
am.getRegionStates().logSplit(this.serverName);
LOG.debug("Done splitting WALs {}", this);
}
use of org.apache.hadoop.hbase.master.MasterWalManager in project hbase by apache.
the class ServerCrashProcedure method splitLogs.
private void splitLogs(final MasterProcedureEnv env) throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("Splitting logs from " + serverName + "; region count=" + size(this.regionsOnCrashedServer));
}
MasterWalManager mwm = env.getMasterServices().getMasterWalManager();
AssignmentManager am = env.getMasterServices().getAssignmentManager();
// TODO: For Matteo. Below BLOCKs!!!! Redo so can relinquish executor while it is running.
mwm.splitLog(this.serverName);
am.getRegionStates().logSplit(this.serverName);
}
use of org.apache.hadoop.hbase.master.MasterWalManager in project hbase by apache.
the class ServerCrashProcedure method processMeta.
/**
* @param env
* @return False if we fail to assign and split logs on meta ('process').
* @throws IOException
* @throws InterruptedException
*/
private boolean processMeta(final MasterProcedureEnv env) throws IOException {
if (LOG.isDebugEnabled())
LOG.debug("Processing hbase:meta that was on " + this.serverName);
MasterWalManager mwm = env.getMasterServices().getMasterWalManager();
AssignmentManager am = env.getMasterServices().getAssignmentManager();
HRegionInfo metaHRI = HRegionInfo.FIRST_META_REGIONINFO;
if (this.shouldSplitWal) {
if (this.distributedLogReplay) {
prepareLogReplay(env, META_REGION_SET);
} else {
// TODO: Matteo. We BLOCK here but most important thing to be doing at this moment.
mwm.splitMetaLog(serverName);
am.getRegionStates().logSplit(metaHRI);
}
}
// Assign meta if still carrying it. Check again: region may be assigned because of RIT timeout
boolean processed = true;
if (am.isCarryingMeta(serverName)) {
// TODO: May block here if hard time figuring state of meta.
am.regionOffline(HRegionInfo.FIRST_META_REGIONINFO);
verifyAndAssignMetaWithRetries(env);
if (this.shouldSplitWal && distributedLogReplay) {
int timeout = env.getMasterConfiguration().getInt(KEY_WAIT_ON_RIT, DEFAULT_WAIT_ON_RIT);
if (!waitOnRegionToClearRegionsInTransition(am, metaHRI, timeout)) {
processed = false;
} else {
// TODO: Matteo. We BLOCK here but most important thing to be doing at this moment.
mwm.splitMetaLog(serverName);
}
}
}
return processed;
}
Aggregations