cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arvind Nithrakashyap (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-12539) Empty CommitLog prevents restart
Date Fri, 28 Oct 2016 07:53:58 GMT

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

Arvind Nithrakashyap commented on CASSANDRA-12539:
--------------------------------------------------

It looks like a crash while writing the logfile can lead to a zero byte file. The following
patch which causes a crash at a specific point reliably produces a commit log full of zeros

{noformat}
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
index 0a03c3c..20cddf8 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
@@ -153,6 +153,7 @@ public abstract class CommitLogSegment
         descriptor = new CommitLogDescriptor(id, commitLog.configuration.getCompressorClass());
         logFile = new File(commitLog.location, descriptor.fileName());
 +        logger.error("location="+descriptor.fileName());
         try
         {
             channel = FileChannel.open(logFile.toPath(), StandardOpenOption.WRITE, StandardOpenOption.READ,
StandardOpenOption.CREATE);
@@ -164,6 +165,9 @@ public abstract class CommitLogSegment
         }
 
         buffer = createBuffer(commitLog);
+        if (true) {
+          throw new IllegalArgumentException("Here!");
+        }
         // write the header
         CommitLogDescriptor.writeHeader(buffer, descriptor);
         endOfBuffer = buffer.capacity();
{noformat}

> Empty CommitLog prevents restart
> --------------------------------
>
>                 Key: CASSANDRA-12539
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12539
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Stefano Ortolani
>
> A node just crashed (known cause: CASSANDRA-11594) but to my surprise (unlike other time)
restarting simply fails.
> Checking the logs showed:
> {noformat}
> ERROR [main] 2016-08-25 17:05:22,611 JVMStabilityInspector.java:82 - Exiting due to error
while processing commit log during initialization.
> org.apache.cassandra.db.commitlog.CommitLogReplayer$CommitLogReplayException: Could not
read commit log descriptor in file /data/cassandra/commitlog/CommitLog-6-1468235564433.log
> 	at org.apache.cassandra.db.commitlog.CommitLogReplayer.handleReplayError(CommitLogReplayer.java:650)
[apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:327)
[apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:148)
[apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:181) [apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:161) [apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:289) [apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:557) [apache-cassandra-3.0.8.jar:3.0.8]
> 	at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:685) [apache-cassandra-3.0.8.jar:3.0.8]
> INFO  [main] 2016-08-25 17:08:56,944 YamlConfigurationLoader.java:85 - Configuration
location: file:/etc/cassandra/cassandra.yaml
> {noformat}
> Deleting the empty file fixes the problem.



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

Mime
View raw message