From 3b585e5a5e5a23b549f2e6fea719556b82592898 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 10 Dec 2014 11:05:38 +0100 Subject: [PATCH] Add more trace logging to gateway translog recovery --- .../index/gateway/local/LocalIndexShardGateway.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java b/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java index 8e53a011f72..41a3401bfdc 100644 --- a/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java +++ b/src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java @@ -250,12 +250,13 @@ public class LocalIndexShardGateway extends AbstractIndexShardComponent implemen final Set typesToUpdate = Sets.newHashSet(); try { + logger.trace("recovering translog file: {} length: {}", recoveringTranslogFile, Files.size(recoveringTranslogFile)); TranslogStream stream = TranslogStreams.translogStreamFor(recoveringTranslogFile); try { in = stream.openInput(recoveringTranslogFile); } catch (TruncatedTranslogException e) { // file is empty or header has been half-written and should be ignored - logger.trace("ignoring truncation exception, the translog is either empty or half-written ([{}])", e.getMessage()); + logger.trace("ignoring truncation exception, the translog is either empty or half-written", e); } while (true) { if (in == null) { @@ -269,11 +270,11 @@ public class LocalIndexShardGateway extends AbstractIndexShardComponent implemen operation = stream.read(in); } catch (EOFException e) { // ignore, not properly written the last op - logger.trace("ignoring translog EOF exception, the last operation was not properly written ([{}])", e.getMessage()); + logger.trace("ignoring translog EOF exception, the last operation was not properly written", e); break; } catch (IOException e) { // ignore, not properly written last op - logger.trace("ignoring translog IO exception, the last operation was not properly written ([{}])", e.getMessage()); + logger.trace("ignoring translog IO exception, the last operation was not properly written", e); break; } try {