cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject [5/6] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.3
Date Mon, 01 Feb 2016 22:07:22 GMT
Merge branch 'cassandra-3.0' into cassandra-3.3


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

Branch: refs/heads/cassandra-3.3
Commit: 2e965f0e43ef0d7d282338fca130b4b545effe7b
Parents: 4d5873d 839a5ba
Author: Carl Yeksigian <carl@apache.org>
Authored: Mon Feb 1 17:01:03 2016 -0500
Committer: Carl Yeksigian <carl@apache.org>
Committed: Mon Feb 1 17:01:03 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 src/java/org/apache/cassandra/db/Keyspace.java  | 32 +++++++++++++-------
 src/java/org/apache/cassandra/db/Mutation.java  | 19 ++++++++++--
 .../cassandra/db/MutationVerbHandler.java       | 25 ++++++++++++---
 .../db/commitlog/CommitLogReplayer.java         |  4 ++-
 .../cassandra/service/paxos/PaxosState.java     | 12 ++++++--
 6 files changed, 72 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e965f0e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index aa4f981,bed8703..bad296b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,8 -1,5 +1,9 @@@
 -3.0.3
 +3.3
 + * Avoid infinite loop if owned range is smaller than number of
 +   data dirs (CASSANDRA-11034)
 + * Avoid bootstrap hanging when existing nodes have no data to stream (CASSANDRA-11010)
 +Merged from 3.0:
+  * Mutations do not block for completion under view lock contention (CASSANDRA-10779)
   * Invalidate legacy schema tables when unloading them (CASSANDRA-11071)
   * (cqlsh) handle INSERT and UPDATE statements with LWT conditions correctly
     (CASSANDRA-11003)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e965f0e/src/java/org/apache/cassandra/db/Mutation.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2e965f0e/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
index e97b36e,b4472ed..3a9f5e6
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java
@@@ -88,65 -84,6 +90,65 @@@ public class CommitLogReplaye
      private final ReplayFilter replayFilter;
      private final CommitLogArchiver archiver;
  
 +    /*
 +     * Wrapper around initiating mutations read from the log to make it possible
 +     * to spy on initiated mutations for test
 +     */
 +    @VisibleForTesting
 +    public static class MutationInitiator
 +    {
 +        protected Future<Integer> initiateMutation(final Mutation mutation,
 +                                                   final long segmentId,
 +                                                   final int serializedSize,
 +                                                   final long entryLocation,
 +                                                   final CommitLogReplayer clr)
 +        {
 +            Runnable runnable = new WrappedRunnable()
 +            {
 +                public void runMayThrow() throws IOException
 +                {
 +                    if (Schema.instance.getKSMetaData(mutation.getKeyspaceName()) == null)
 +                        return;
 +                    if (clr.pointInTimeExceeded(mutation))
 +                        return;
 +
 +                    final Keyspace keyspace = Keyspace.open(mutation.getKeyspaceName());
 +
 +                    // Rebuild the mutation, omitting column families that
 +                    //    a) the user has requested that we ignore,
 +                    //    b) have already been flushed,
 +                    // or c) are part of a cf that was dropped.
 +                    // Keep in mind that the cf.name() is suspect. do every thing based
on the cfid instead.
 +                    Mutation newMutation = null;
 +                    for (PartitionUpdate update : clr.replayFilter.filter(mutation))
 +                    {
 +                        if (Schema.instance.getCF(update.metadata().cfId) == null)
 +                            continue; // dropped
 +
 +                        ReplayPosition rp = clr.cfPositions.get(update.metadata().cfId);
 +
 +                        // replay if current segment is newer than last flushed one or,
 +                        // if it is the last known segment, if we are after the replay position
 +                        if (segmentId > rp.segment || (segmentId == rp.segment &&
entryLocation > rp.position))
 +                        {
 +                            if (newMutation == null)
 +                                newMutation = new Mutation(mutation.getKeyspaceName(), mutation.key());
 +                            newMutation.add(update);
 +                            clr.replayedCount.incrementAndGet();
 +                        }
 +                    }
 +                    if (newMutation != null)
 +                    {
 +                        assert !newMutation.isEmpty();
-                         Keyspace.open(newMutation.getKeyspaceName()).applyFromCommitLog(newMutation);
++                        Uninterruptibles.getUninterruptibly(Keyspace.open(newMutation.getKeyspaceName()).applyFromCommitLog(newMutation));
 +                        clr.keyspacesRecovered.add(keyspace);
 +                    }
 +                }
 +            };
 +            return StageManager.getStage(Stage.MUTATION).submit(runnable, serializedSize);
 +        }
 +    }
 +
      CommitLogReplayer(CommitLog commitLog, ReplayPosition globalPosition, Map<UUID, ReplayPosition>
cfPositions, ReplayFilter replayFilter)
      {
          this.keyspacesRecovered = new NonBlockingHashSet<Keyspace>();


Mime
View raw message