HBASE-24574 Procedure V2 - Distributed WAL Splitting => LOGGING (#1912)

Addendum; minor log edits
This commit is contained in:
stack 2020-06-18 08:37:19 -07:00
parent aadd2bb1a1
commit 489f07d945
6 changed files with 23 additions and 21 deletions

View File

@ -185,8 +185,11 @@ public class SplitWALProcedure
@Override @Override
protected void afterReplay(MasterProcedureEnv env){ protected void afterReplay(MasterProcedureEnv env){
if(worker != null){ if (worker != null) {
env.getMasterServices().getSplitWALManager().addUsedSplitWALWorker(worker); if (env != null && env.getMasterServices() != null &&
env.getMasterServices().getSplitWALManager() != null) {
env.getMasterServices().getSplitWALManager().addUsedSplitWALWorker(worker);
}
} }
} }

View File

@ -57,11 +57,11 @@ class RemoteProcedureResultReporter extends Thread {
public void complete(long procId, Throwable error) { public void complete(long procId, Throwable error) {
RemoteProcedureResult.Builder builder = RemoteProcedureResult.newBuilder().setProcId(procId); RemoteProcedureResult.Builder builder = RemoteProcedureResult.newBuilder().setProcId(procId);
if (error != null) { if (error != null) {
LOG.debug("Failed to complete execution of proc pid={}", procId, error); LOG.debug("Failed to complete execution of pid={}", procId, error);
builder.setStatus(RemoteProcedureResult.Status.ERROR).setError( builder.setStatus(RemoteProcedureResult.Status.ERROR).setError(
ForeignExceptionUtil.toProtoForeignException(server.getServerName().toString(), error)); ForeignExceptionUtil.toProtoForeignException(server.getServerName().toString(), error));
} else { } else {
LOG.debug("Successfully complete execution of proc pid={}", procId); LOG.debug("Successfully complete execution of pid={}", procId);
builder.setStatus(RemoteProcedureResult.Status.SUCCESS); builder.setStatus(RemoteProcedureResult.Status.SUCCESS);
} }
results.add(builder.build()); results.add(builder.build());
@ -102,7 +102,7 @@ class RemoteProcedureResultReporter extends Thread {
} else { } else {
pauseTime = INIT_PAUSE_TIME_MS; // Reset. pauseTime = INIT_PAUSE_TIME_MS; // Reset.
} }
LOG.info("Failed report procedure " + TextFormat.shortDebugString(request) + "; retry (#" + LOG.info("Failed procedure report " + TextFormat.shortDebugString(request) + "; retry (#" +
tries + ")" + (pause ? " after " + pauseTime + "ms delay (Master is coming online...)." tries + ")" + (pause ? " after " + pauseTime + "ms delay (Master is coming online...)."
: " immediately."), : " immediately."),
e); e);

View File

@ -1,5 +1,4 @@
/** /*
*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information * distributed with this work for additional information
@ -49,7 +48,6 @@ import org.apache.hadoop.hbase.wal.WALSplitter;
import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceAudience;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting; import org.apache.hbase.thirdparty.com.google.common.annotations.VisibleForTesting;
/** /**
@ -162,7 +160,7 @@ public class SplitLogWorker implements Runnable {
walDir = CommonFSUtils.getWALRootDir(conf); walDir = CommonFSUtils.getWALRootDir(conf);
fs = walDir.getFileSystem(conf); fs = walDir.getFileSystem(conf);
} catch (IOException e) { } catch (IOException e) {
LOG.warn("could not find root dir or fs", e); LOG.warn("Resigning, could not find root dir or fs", e);
return Status.RESIGNED; return Status.RESIGNED;
} }
try { try {
@ -185,25 +183,24 @@ public class SplitLogWorker implements Runnable {
return Status.PREEMPTED; return Status.PREEMPTED;
} }
} catch (InterruptedIOException iioe) { } catch (InterruptedIOException iioe) {
LOG.warn("log splitting of " + name + " interrupted, resigning", iioe); LOG.warn("Resigning, interrupted splitting WAL {}", filename, iioe);
return Status.RESIGNED; return Status.RESIGNED;
} catch (IOException e) { } catch (IOException e) {
if (e instanceof FileNotFoundException) { if (e instanceof FileNotFoundException) {
// A wal file may not exist anymore. Nothing can be recovered so move on // A wal file may not exist anymore. Nothing can be recovered so move on
LOG.warn("WAL {} does not exist anymore", name, e); LOG.warn("Done, WAL {} does not exist anymore", filename, e);
return Status.DONE; return Status.DONE;
} }
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if (e instanceof RetriesExhaustedException && (cause instanceof NotServingRegionException || if (e instanceof RetriesExhaustedException && (cause instanceof NotServingRegionException
cause instanceof ConnectException || cause instanceof SocketTimeoutException)) { || cause instanceof ConnectException || cause instanceof SocketTimeoutException)) {
LOG.warn("log replaying of " + name + " can't connect to the target regionserver, " + LOG.warn("Resigning, can't connect to target regionserver splitting WAL {}", filename, e);
"resigning", e);
return Status.RESIGNED; return Status.RESIGNED;
} else if (cause instanceof InterruptedException) { } else if (cause instanceof InterruptedException) {
LOG.warn("log splitting of " + name + " interrupted, resigning", e); LOG.warn("Resigning, interrupted splitting WAL {}", filename, e);
return Status.RESIGNED; return Status.RESIGNED;
} }
LOG.warn("log splitting of " + name + " failed, returning error", e); LOG.warn("Error splitting WAL {}", filename, e);
return Status.ERR; return Status.ERR;
} }
return Status.DONE; return Status.DONE;

View File

@ -101,9 +101,9 @@ public class SplitWALCallable implements RSProcedureCallable {
private void splitWal() throws IOException { private void splitWal() throws IOException {
SplitLogWorker.TaskExecutor.Status status = SplitLogWorker.TaskExecutor.Status status =
SplitLogWorker.splitLog(walPath, null, rs.getConfiguration(), rs, rs, rs.getWalFactory()); SplitLogWorker.splitLog(walPath, null, rs.getConfiguration(), rs, rs, rs.getWalFactory());
if (status != SplitLogWorker.TaskExecutor.Status.DONE) { if (status != SplitLogWorker.TaskExecutor.Status.DONE) {
throw new IOException("Split WAL " + walPath + " failed at server "); throw new IOException("Failed WAL split, status=" + status + ", wal=" + walPath);
} }
} }
} }

View File

@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.util.CancelableProgressable;
/** /**
* Handles log splitting a wal * Handles log splitting a wal
* Used by the zk-based distributed log splitting. Created by ZKSplitLogWorkerCoordination.
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public class WALSplitterHandler extends EventHandler { public class WALSplitterHandler extends EventHandler {

View File

@ -226,13 +226,14 @@ public class BoundedRecoveredHFilesOutputSink extends OutputSink {
try { try {
return walSplitter.rsServices.getConnection().getAdmin().getDescriptor(tableName); return walSplitter.rsServices.getConnection().getAdmin().getDescriptor(tableName);
} catch (IOException e) { } catch (IOException e) {
LOG.warn("Failed to get table descriptor for table {}", tableName, e); LOG.warn("Failed to get table descriptor for {}", tableName, e);
} }
} }
LOG.info("Failed getting {} table descriptor from master; trying local", tableName);
try { try {
return walSplitter.tableDescriptors.get(tableName); return walSplitter.tableDescriptors.get(tableName);
} catch (IOException e) { } catch (IOException e) {
LOG.warn("Failed to get table descriptor for table {}", tableName, e); LOG.warn("Failed to get table descriptor for {}", tableName, e);
return null; return null;
} }
} }