cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [12/22] cassandra git commit: Fix leak on skipped SSTables in sstableupgrade
Date Mon, 28 Nov 2016 22:23:13 GMT
Fix leak on skipped SSTables in sstableupgrade

patch by yukim; reviewed by Paulo Motta for CASSANDRA-12899


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

Branch: refs/heads/cassandra-2.2
Commit: 4fff69fcbe78b118615dfc50fad2acbac5b62566
Parents: 801c1a5
Author: Yuki Morishita <yukim@apache.org>
Authored: Mon Nov 28 16:08:42 2016 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Mon Nov 28 16:08:42 2016 -0600

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 src/java/org/apache/cassandra/tools/StandaloneUpgrader.java | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4fff69fc/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5a2e0ab..cc8ef21 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.9
+ * Fix leak on skipped SSTables in sstableupgrade (CASSANDRA-12899)
  * Avoid blocking gossip during pending range calculation (CASSANDRA-12281)
  * Fix purgeability of tombstones with max timestamp (CASSANDRA-12792)
  * Fail repair if participant dies during sync or anticompaction (CASSANDRA-12901)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4fff69fc/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java b/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
index 2c2a7e0..23342bc 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneUpgrader.java
@@ -20,7 +20,6 @@ package org.apache.cassandra.tools;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.cassandra.io.sstable.format.SSTableReader;
 import org.apache.commons.cli.*;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
@@ -33,6 +32,7 @@ import org.apache.cassandra.db.compaction.OperationType;
 import org.apache.cassandra.db.compaction.Upgrader;
 import org.apache.cassandra.db.lifecycle.LifecycleTransaction;
 import org.apache.cassandra.io.sstable.*;
+import org.apache.cassandra.io.sstable.format.SSTableReader;
 import org.apache.cassandra.utils.JVMStabilityInspector;
 import org.apache.cassandra.utils.OutputHandler;
 
@@ -83,7 +83,10 @@ public class StandaloneUpgrader
                 {
                     SSTableReader sstable = SSTableReader.openNoValidation(entry.getKey(),
components, cfs);
                     if (sstable.descriptor.version.equals(DatabaseDescriptor.getSSTableFormat().info.getLatestVersion()))
+                    {
+                        sstable.selfRef().release();
                         continue;
+                    }
                     readers.add(sstable);
                 }
                 catch (Exception e)
@@ -92,8 +95,6 @@ public class StandaloneUpgrader
                     System.err.println(String.format("Error Loading %s: %s", entry.getKey(),
e.getMessage()));
                     if (options.debug)
                         e.printStackTrace(System.err);
-
-                    continue;
                 }
             }
 


Mime
View raw message