Merge branch 'cassandra-2.1' into cassandra-2.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/20ce2cf3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/20ce2cf3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/20ce2cf3 Branch: refs/heads/cassandra-3.0 Commit: 20ce2cf3564a113b6bcd9c4bc761dfeac37349a6 Parents: f497c13 27c8011 Author: Robert Stupp <[email protected]> Authored: Sat Oct 17 11:38:27 2015 +0200 Committer: Robert Stupp <[email protected]> Committed: Sat Oct 17 11:38:27 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/db/commitlog/CommitLogSegmentManager.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/20ce2cf3/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 632e262,7358689..889438f --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,7 -1,6 +1,8 @@@ -2.1.12 +2.2.4 + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * AssertionError: attempted to delete non-existing file CommitLog (CASSANDRA-10377) - * Merge range tombstones during compaction (CASSANDRA-7953) * (cqlsh) Distinguish negative and positive infinity in output (CASSANDRA-10523) * (cqlsh) allow custom time_format for COPY TO (CASSANDRA-8970) * Don't allow startup if the node's rack has changed (CASSANDRA-10242) http://git-wip-us.apache.org/repos/asf/cassandra/blob/20ce2cf3/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java index f71bb1b,9310d67..2ca2fea --- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java +++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java @@@ -339,10 -346,32 +339,16 @@@ public class CommitLogSegmentManage */ void recycleSegment(final CommitLogSegment segment) { - boolean archiveSuccess = CommitLog.instance.archiver.maybeWaitForArchiving(segment.getName()); - if (!activeSegments.remove(segment)) - { - logger.warn("segment {} not found in activeSegments queue", segment); - return; - } - if (!archiveSuccess) + boolean archiveSuccess = commitLog.archiver.maybeWaitForArchiving(segment.getName()); - activeSegments.remove(segment); - // if archiving (command) was not successful then leave the file alone. don't delete or recycle. - discardSegment(segment, archiveSuccess); ++ if (activeSegments.remove(segment)) + { + // if archiving (command) was not successful then leave the file alone. don't delete or recycle. - discardSegment(segment, false); - return; ++ discardSegment(segment, archiveSuccess); + } - if (isCapExceeded() || !DatabaseDescriptor.getCommitLogSegmentRecyclingEnabled()) ++ else + { - discardSegment(segment, true); - return; ++ logger.warn("segment {} not found in activeSegments queue", segment); + } - - logger.debug("Recycling {}", segment); - segmentManagementTasks.add(new Callable<CommitLogSegment>() - { - public CommitLogSegment call() - { - return segment.recycle(); - } - }); } /**
