cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: Followup to CASSANDRA-6916 - only close bf if we have not opened early.
Date Tue, 13 May 2014 08:09:38 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 81bf2b088 -> 5a79f5631


Followup to CASSANDRA-6916 - only close bf if we have not opened early.

Patch by benedict; reviewed by marcuse for CASSANDRA-6916.


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5a79f563
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5a79f563
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5a79f563

Branch: refs/heads/cassandra-2.1
Commit: 5a79f56316f426942c63e7899744a5a219fdc7b3
Parents: 81bf2b0
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Tue May 13 10:05:15 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Tue May 13 10:08:54 2014 +0200

----------------------------------------------------------------------
 .../org/apache/cassandra/io/sstable/SSTableRewriter.java    | 2 +-
 src/java/org/apache/cassandra/io/sstable/SSTableWriter.java | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a79f563/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
index 553993a..4f8548c 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
@@ -199,7 +199,7 @@ public class SSTableRewriter
             dataTracker.replaceReaders(close, Collections.<SSTableReader>emptyList());
             dataTracker.unmarkCompacting(close);
         }
-        writer.abort();
+        writer.abort(currentlyOpenedEarly == null);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5a79f563/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
index f29e4a3..9e667f6 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
@@ -323,13 +323,20 @@ public class SSTableWriter extends SSTable
      */
     public void abort()
     {
+        abort(true);
+    }
+    public void abort(boolean closeBf)
+    {
         assert descriptor.type.isTemporary;
         if (iwriter == null && dataFile == null)
             return;
         if (iwriter != null)
         {
             FileUtils.closeQuietly(iwriter.indexFile);
-            iwriter.bf.close();
+            if (closeBf)
+            {
+                iwriter.bf.close();
+            }
         }
         if (dataFile!= null)
             FileUtils.closeQuietly(dataFile);


Mime
View raw message