You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Andy Tolbert (JIRA)" <ji...@apache.org> on 2016/08/11 04:34:20 UTC

[jira] [Commented] (CASSANDRA-11595) Cassandra cannot start because of empty commitlog

    [ https://issues.apache.org/jira/browse/CASSANDRA-11595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416539#comment-15416539 ] 

Andy Tolbert commented on CASSANDRA-11595:
------------------------------------------

Was talking with a user who also encountered this same problem (also on windows), however in their case their Commitlog was 32MB, but was completely zero'd out.  Their system had been power cycled and upon restart they hit this error.

I was looking at the code and saw that when reading commitlogs prior to 2.1 a [different code path|https://github.com/apache/cassandra/blob/cassandra-3.7/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L358] would be taken for reading commitlogs which seemed to [gracefully proceed|https://github.com/apache/cassandra/blob/cassandra-3.7/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L464-L468] when reading 0.  Although in that case no header would be read from like it is for [newer commitlogs|https://github.com/apache/cassandra/blob/cassandra-3.7/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L370].

Should it be considered mandatory that the header content is present in the commitlog as it currently is?  In this case it seems like there is no risk in the user simply deleting the file and moving on since it doesn't contain anything anyways.  Although maybe there is still a problem somewhere since the file has no header in the first place.

> Cassandra cannot start because of empty commitlog
> -------------------------------------------------
>
>                 Key: CASSANDRA-11595
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11595
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: n0rad
>            Assignee: Benjamin Lerer
>
> After the crash of CASSANDRA-11594.
> Cassandra try to restart and fail because of commit log replay.
> Same on 4 of the crashed nodes out of 6.
> ```
> org.apache.cassandra.db.commitlog.CommitLogReplayer$CommitLogReplayException: Could not read commit log descriptor in file /data/commitlog/CommitLog-6-1460632496764.log
> at org.apache.cassandra.db.commitlog.CommitLogReplayer.handleReplayError(CommitLogReplayer.java:644) [apache-cassandra-3.0.5.jar:3.0.5]
> ```
> This file is empty and is not the commitlog with the latest date.
> ```
> ...
> -rw-r--r-- 1 root root 32M Apr 16 21:46 CommitLog-6-1460632496761.log
> -rw-r--r-- 1 root root 32M Apr 16 21:47 CommitLog-6-1460632496762.log
> -rw-r--r-- 1 root root 32M Apr 16 21:47 CommitLog-6-1460632496763.log
> -rw-r--r-- 1 root root   0 Apr 16 21:47 CommitLog-6-1460632496764.log
> -rw-r--r-- 1 root root 32M Apr 16 21:50 CommitLog-6-1460843401097.log
> -rw-r--r-- 1 root root 32M Apr 16 21:51 CommitLog-6-1460843513346.log
> -rw-r--r-- 1 root root 32M Apr 16 21:53 CommitLog-6-1460843619271.log
> -rw-r--r-- 1 root root 32M Apr 16 21:55 CommitLog-6-1460843730533.log
> -rw-r--r-- 1 root root 32M Apr 16 21:57 CommitLog-6-1460843834129.log
> -rw-r--r-- 1 root root 32M Apr 16 21:58 CommitLog-6-1460843935094.log
> -rw-r--r-- 1 root root 32M Apr 16 22:00 CommitLog-6-1460844038543.log
> -rw-r--r-- 1 root root 32M Apr 16 22:02 CommitLog-6-1460844141003.log
> ...
> ```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)