cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/3] git commit: commitlog cleanup; fixes stderr for RecoveryManager2Test on Windows
Date Fri, 29 Jun 2012 00:16:45 GMT
commitlog cleanup; fixes stderr for RecoveryManager2Test on Windows


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

Branch: refs/heads/trunk
Commit: 67c26d4715a2ad699eccd749971671aa7e487a4d
Parents: bc2dea8
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Jun 28 19:12:01 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Jun 28 19:15:52 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/db/commitlog/CommitLog.java   |    1 +
 .../cassandra/db/commitlog/CommitLogAllocator.java |    2 +-
 .../cassandra/db/commitlog/CommitLogReplayer.java  |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/67c26d47/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 a490569..0b0aa27 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -329,6 +329,7 @@ public class CommitLog implements CommitLogMBean
     private void activateNextSegment() throws IOException
     {
         activeSegment = allocator.fetchSegment();
+        logger.debug("Active segment is now {}", activeSegment);
     }
 
     public List<String> getActiveSegmentNames()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/67c26d47/src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
index 5d8636d..0634fa3 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java
@@ -330,7 +330,7 @@ public class CommitLogAllocator
         while (!queue.isEmpty())
             Thread.yield();
 
-        for (CommitLogSegment segment : activeSegments)
+        for (CommitLogSegment segment : Iterables.concat(activeSegments, availableSegments))
             segment.close();
 
         activeSegments.clear();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/67c26d47/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
index 0371d8b..e12e5ba 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
@@ -119,9 +119,9 @@ private final AtomicInteger replayedCount;
         logger.info("Replaying " + file.getPath());
         final long segment = CommitLogSegment.idFromFilename(file.getName());
         RandomAccessReader reader = RandomAccessReader.open(new File(file.getAbsolutePath()),
true);
-        assert reader.length() <= Integer.MAX_VALUE;
         try
         {
+            assert reader.length() <= Integer.MAX_VALUE;
             int replayPosition;
             if (globalPosition.segment < segment)
                 replayPosition = 0;


Mime
View raw message