You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2014/04/22 15:34:22 UTC

[2/3] git commit: mark dropped CFs clean in commitlog patch by Benedict Elliott Smith; reviewed by jbellis for CASSANDRA-6959

mark dropped CFs clean in commitlog
patch by Benedict Elliott Smith; reviewed by jbellis for CASSANDRA-6959


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

Branch: refs/heads/trunk
Commit: 75c185199d403dbd6d1220a4f4dcd1553c98c15f
Parents: 510c82e
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Apr 22 08:33:12 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Apr 22 08:33:12 2014 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/DefsTables.java          | 2 ++
 src/java/org/apache/cassandra/db/commitlog/CommitLog.java | 7 +++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/75c18519/src/java/org/apache/cassandra/db/DefsTables.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefsTables.java b/src/java/org/apache/cassandra/db/DefsTables.java
index 6f1cc69..351ee4b 100644
--- a/src/java/org/apache/cassandra/db/DefsTables.java
+++ b/src/java/org/apache/cassandra/db/DefsTables.java
@@ -464,6 +464,7 @@ public class DefsTables
                     cfs.snapshot(snapshotName);
                 Keyspace.open(ksm.name).dropCf(cfm.cfId);
             }
+            CommitLog.instance.discardColumnFamily(cfm.cfId);
         }
 
         // remove the keyspace from the static instances.
@@ -494,6 +495,7 @@ public class DefsTables
 
         CompactionManager.instance.interruptCompactionFor(Arrays.asList(cfm), true);
 
+        CommitLog.instance.discardColumnFamily(cfm.cfId);
         CommitLog.instance.forceRecycleAllSegments();
 
         if (!StorageService.instance.isClientMode())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/75c18519/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
index 48ddb5a..a230e35 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -237,6 +237,13 @@ public class CommitLog implements CommitLogMBean
         return alloc;
     }
 
+    public void discardColumnFamily(final UUID cfId)
+    {
+        ReplayPosition context = getContext();
+        for (CommitLogSegment cls : allocator.getActiveSegments())
+            cls.markClean(cfId, context);
+    }
+
     /**
      * Modifies the per-CF dirty cursors of any commit log segments for the column family according to the position
      * given. Discards any commit log segments that are no longer used.