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
This commit is contained in:
Jonathan Ellis 2010-06-22 16:35:55 +00:00
parent cb00345edc
commit 759e053fdb
1 changed files with 4 additions and 2 deletions

View File

@ -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);