From 759e053fdb27b89956d7488b431e3aef424cdb6e Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Tue, 22 Jun 2010 16:35:55 +0000 Subject: [PATCH] avoid logging exception at INFO when cl header is missing / corrupt (common on power loss, now that we don't fsync it). patch by jbellis git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@956944 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/cassandra/db/commitlog/CommitLog.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java index 14f07ef0d2..db27403a6c 100644 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java @@ -188,14 +188,16 @@ public class CommitLog BufferedRandomAccessFile reader = new BufferedRandomAccessFile(file.getAbsolutePath(), "r", bufferSize); int replayPosition = 0; + String headerPath = CommitLogHeader.getHeaderPathFromSegmentPath(file.getAbsolutePath()); try { - clHeader = CommitLogHeader.readCommitLogHeader(CommitLogHeader.getHeaderPathFromSegmentPath(file.getAbsolutePath())); + clHeader = CommitLogHeader.readCommitLogHeader(headerPath); replayPosition = clHeader.getReplayPosition(); } catch (IOException ioe) { - logger.info("Attempted to read an incomplete, missing or corrupt CommitLogHeader. Everything is ok, don't panic. CommitLog will be replayed from the beginning", ioe); + logger.info(headerPath + " incomplete, missing or corrupt. Everything is ok, don't panic. CommitLog will be replayed from the beginning"); + logger.debug("exception was", ioe); } reader.seek(replayPosition);