From d03c046acbcfe3e3a9d8fafa628030cc3fc40f34 Mon Sep 17 00:00:00 2001 From: Jaydeepkumar Chovatia Date: Fri, 9 Jun 2017 16:08:32 -0700 Subject: [PATCH] enable segement creation before recovering commitlogs patch by Jaydeepkumar Chovatia, reviewed by jasobrown for CASSANDRA-13587 --- CHANGES.txt | 1 + src/java/org/apache/cassandra/db/commitlog/CommitLog.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6609b05722..452dc9bcf1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.15 + * enable segement creation before recovering commitlogs (CASSANDRA-13587) * Fix AssertionError in short read protection (CASSANDRA-13747) * Don't skip corrupted sstables on startup (CASSANDRA-13620) * Fix the merging of cells with different user type versions (CASSANDRA-13776) diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java index d167735fcf..40040edfac 100644 --- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java @@ -150,6 +150,7 @@ public class CommitLog implements CommitLogMBean File[] files = new File(DatabaseDescriptor.getCommitLogLocation()).listFiles(unmanagedFilesFilter); int replayed = 0; + allocator.enableReserveSegmentCreation(); if (files.length == 0) { logger.info("No commitlog files found; skipping replay"); @@ -165,7 +166,6 @@ public class CommitLog implements CommitLogMBean allocator.recycleSegment(f); } - allocator.enableReserveSegmentCreation(); return replayed; }