HBASE-23687 DEBUG logging cleanup (#1040)

Signed-off-by: Jan Hentschel <janh@apache.org>
This commit is contained in:
Michael Stack 2020-01-14 22:07:23 -08:00 committed by GitHub
parent 4a35e2f837
commit 602f6dd693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 13 deletions

View File

@ -148,7 +148,7 @@ class RootProcedureState<TEnvironment> {
subprocStack = new ArrayList<>(); subprocStack = new ArrayList<>();
} }
proc.addStackIndex(subprocStack.size()); proc.addStackIndex(subprocStack.size());
LOG.debug("Add procedure {} as the {}th rollback step", proc, subprocStack.size()); LOG.trace("Add procedure {} as the {}th rollback step", proc, subprocStack.size());
subprocStack.add(proc); subprocStack.add(proc);
} }

View File

@ -26,6 +26,8 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
@ -111,8 +113,13 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
results.add(new CleanerContext(file)); results.add(new CleanerContext(file));
} }
} }
if (results.isEmpty()) {
return 0;
}
LOG.debug("Old WAL files pending deletion: {}", results); LOG.debug("Old WALs for delete: {}",
results.stream().map(cc -> cc.target.getPath().getName()).
collect(Collectors.joining(", ")));
pendingDelete.addAll(results); pendingDelete.addAll(results);
int deletedFiles = 0; int deletedFiles = 0;
@ -140,7 +147,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
} }
private List<Thread> createOldWalsCleaner(int size) { private List<Thread> createOldWalsCleaner(int size) {
LOG.info("Creating {} OldWALs cleaner threads", size); LOG.info("Creating {} old WALs cleaner threads", size);
List<Thread> oldWALsCleaner = new ArrayList<>(size); List<Thread> oldWALsCleaner = new ArrayList<>(size);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
@ -168,12 +175,12 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
Preconditions.checkNotNull(context); Preconditions.checkNotNull(context);
FileStatus oldWalFile = context.getTargetToClean(); FileStatus oldWalFile = context.getTargetToClean();
try { try {
LOG.debug("Attempting to delete old WAL file: {}", oldWalFile); LOG.debug("Deleting {}", oldWalFile);
boolean succeed = this.fs.delete(oldWalFile.getPath(), false); boolean succeed = this.fs.delete(oldWalFile.getPath(), false);
context.setResult(succeed); context.setResult(succeed);
} catch (IOException e) { } catch (IOException e) {
// fs.delete() fails. // fs.delete() fails.
LOG.warn("Failed to clean old WAL file", e); LOG.warn("Failed to delete old WAL file", e);
context.setResult(false); context.setResult(false);
} }
} catch (InterruptedException ite) { } catch (InterruptedException ite) {
@ -184,7 +191,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
return; return;
} }
LOG.debug("Exiting"); LOG.trace("Exiting");
} }
} }
@ -217,7 +224,7 @@ public class LogCleaner extends CleanerChore<BaseLogCleanerDelegate>
boolean completed = this.remainingResults.await(waitIfNotFinished, boolean completed = this.remainingResults.await(waitIfNotFinished,
TimeUnit.MILLISECONDS); TimeUnit.MILLISECONDS);
if (!completed) { if (!completed) {
LOG.warn("Spend too much time [{}ms] to delete old WAL file: {}", LOG.warn("Spent too much time [{}ms] deleting old WAL file: {}",
waitIfNotFinished, target); waitIfNotFinished, target);
return false; return false;
} }

View File

@ -348,8 +348,8 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
private static <T extends Comparable<T>> void addToRunQueue(FairQueue<T> fairq, Queue<T> queue, private static <T extends Comparable<T>> void addToRunQueue(FairQueue<T> fairq, Queue<T> queue,
Supplier<String> reason) { Supplier<String> reason) {
if (LOG.isDebugEnabled()) { if (LOG.isTraceEnabled()) {
LOG.debug("Add {} to run queue because: {}", queue, reason.get()); LOG.trace("Add {} to run queue because: {}", queue, reason.get());
} }
if (!AvlIterableList.isLinked(queue) && !queue.isEmpty()) { if (!AvlIterableList.isLinked(queue) && !queue.isEmpty()) {
fairq.add(queue); fairq.add(queue);
@ -358,8 +358,8 @@ public class MasterProcedureScheduler extends AbstractProcedureScheduler {
private static <T extends Comparable<T>> void removeFromRunQueue(FairQueue<T> fairq, private static <T extends Comparable<T>> void removeFromRunQueue(FairQueue<T> fairq,
Queue<T> queue, Supplier<String> reason) { Queue<T> queue, Supplier<String> reason) {
if (LOG.isDebugEnabled()) { if (LOG.isTraceEnabled()) {
LOG.debug("Remove {} from run queue because: {}", queue, reason.get()); LOG.trace("Remove {} from run queue because: {}", queue, reason.get());
} }
if (AvlIterableList.isLinked(queue)) { if (AvlIterableList.isLinked(queue)) {
fairq.remove(queue); fairq.remove(queue);

View File

@ -87,7 +87,7 @@ final class RegionProcedureStoreWALRoller extends AbstractWALRoller<Abortable> {
Path newFile = new Path(globalWALArchiveDir, Path newFile = new Path(globalWALArchiveDir,
file.getName() + MasterProcedureUtil.ARCHIVED_PROC_WAL_SUFFIX); file.getName() + MasterProcedureUtil.ARCHIVED_PROC_WAL_SUFFIX);
if (fs.rename(file, newFile)) { if (fs.rename(file, newFile)) {
LOG.info("Successfully moved {} to {}", file, newFile); LOG.info("Moved {} to {}", file, newFile);
} else { } else {
LOG.warn("Failed to move archived wal from {} to global place {}", file, newFile); LOG.warn("Failed to move archived wal from {} to global place {}", file, newFile);
} }