cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelap...@apache.org
Subject [4/7] cassandra git commit: Merge branch '12952-3.0' into 12952-3.11
Date Fri, 28 Jul 2017 10:29:28 GMT
Merge branch '12952-3.0' into 12952-3.11


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

Branch: refs/heads/trunk
Commit: aa5c073249d05fceae00543dd91ca2f7985c264c
Parents: 7ff4a65 f85b024
Author: Andrés de la Peña <a.penya.garcia@gmail.com>
Authored: Thu Jul 27 11:11:10 2017 +0100
Committer: Andrés de la Peña <a.penya.garcia@gmail.com>
Committed: Thu Jul 27 11:11:10 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cql3/statements/AlterTableStatement.java    |  8 +-----
 .../apache/cassandra/schema/SchemaKeyspace.java |  7 ++----
 .../cassandra/service/MigrationManager.java     | 26 +++++++++++++++++---
 4 files changed, 27 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa5c0732/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index dd8f88b,5e95b75..5be7e1f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,11 -1,7 +1,12 @@@
 +3.11.1
 + * "ignore" option is ignored in sstableloader (CASSANDRA-13721)
 + * Deadlock in AbstractCommitLogSegmentManager (CASSANDRA-13652)
 + * Duplicate the buffer before passing it to analyser in SASI operation (CASSANDRA-13512)
 + * Properly evict pstmts from prepared statements cache (CASSANDRA-13641)
 +Merged from 3.0:
  3.0.15
+  * Fix ALTER TABLE statement to atomically propagate changes to the table and its MVs (CASSANDRA-12952)
   * Fixed ambiguous output of nodetool tablestats command (CASSANDRA-13722)
 - * JMXEnabledThreadPoolExecutor with corePoolSize equal to maxPoolSize (Backport CASSANDRA-13329)
   * Fix Digest mismatch Exception if hints file has UnknownColumnFamily (CASSANDRA-13696)
   * Purge tombstones created by expired cells (CASSANDRA-13643)
   * Make concat work with iterators that have different subsets of columns (CASSANDRA-13482)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa5c0732/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa5c0732/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/schema/SchemaKeyspace.java
index a4baadf,63017ec..03c393f
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
@@@ -746,22 -723,20 +746,19 @@@ public final class SchemaKeyspac
  
          CFMetaData table = view.metadata;
          for (ColumnDefinition column : table.allColumns())
 -            dropColumnFromSchemaMutation(table, column, timestamp, mutation);
 +            dropColumnFromSchemaMutation(table, column, builder);
  
          for (IndexMetadata index : table.getIndexes())
 -            dropIndexFromSchemaMutation(table, index, timestamp, mutation);
 +            dropIndexFromSchemaMutation(table, index, builder);
  
 -        return mutation;
 +        return builder;
      }
  
-     public static Mutation.SimpleBuilder makeUpdateViewMutation(KeyspaceMetadata keyspace,
 -    public static Mutation makeUpdateViewMutation(Mutation mutation,
 -                                                  ViewDefinition oldView,
 -                                                  ViewDefinition newView,
 -                                                  long timestamp)
++    public static Mutation.SimpleBuilder makeUpdateViewMutation(Mutation.SimpleBuilder builder,
 +                                                                ViewDefinition oldView,
-                                                                 ViewDefinition newView,
-                                                                 long timestamp)
++                                                                ViewDefinition newView)
      {
-         Mutation.SimpleBuilder builder = makeCreateKeyspaceMutation(keyspace.name, keyspace.params,
timestamp);
- 
 -        addViewToSchemaMutation(newView, timestamp, false, mutation);
 +        addViewToSchemaMutation(newView, false, builder);
  
          MapDifference<ByteBuffer, ColumnDefinition> columnDiff = Maps.difference(oldView.metadata.getColumnMetadata(),
                                                                                   newView.metadata.getColumnMetadata());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/aa5c0732/src/java/org/apache/cassandra/service/MigrationManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/MigrationManager.java
index 5e2a867,b4893a9..3332d2c
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@@ -423,12 -427,28 +428,28 @@@ public class MigrationManage
  
          oldCfm.validateCompatibility(cfm);
  
+         long timestamp = FBUtilities.timestampMicros();
+ 
 -        logger.info(String.format("Update table '%s/%s' From %s To %s", cfm.ksName, cfm.cfName,
oldCfm, cfm));
 -        Mutation mutation = SchemaKeyspace.makeUpdateTableMutation(ksm, oldCfm, cfm, timestamp);
 +        logger.info("Update table '{}/{}' From {} To {}", cfm.ksName, cfm.cfName, oldCfm,
cfm);
-         announce(SchemaKeyspace.makeUpdateTableMutation(ksm, oldCfm, cfm, FBUtilities.timestampMicros()),
announceLocally);
++        Mutation.SimpleBuilder builder = SchemaKeyspace.makeUpdateTableMutation(ksm, oldCfm,
cfm, timestamp);
+ 
+         if (views != null)
 -            views.forEach(view -> addViewUpdateToMutation(view, mutation, timestamp));
++            views.forEach(view -> addViewUpdateToMutationBuilder(view, builder));
+ 
 -        announce(mutation, announceLocally);
++        announce(builder, announceLocally);
      }
  
      public static void announceViewUpdate(ViewDefinition view, boolean announceLocally)
throws ConfigurationException
      {
+         KeyspaceMetadata ksm = Schema.instance.getKSMetaData(view.ksName);
+         long timestamp = FBUtilities.timestampMicros();
 -        Mutation mutation = SchemaKeyspace.makeCreateKeyspaceMutation(ksm.name, ksm.params,
timestamp);
 -        addViewUpdateToMutation(view, mutation, timestamp);
 -        announce(mutation, announceLocally);
++        Mutation.SimpleBuilder builder = SchemaKeyspace.makeCreateKeyspaceMutation(ksm.name,
ksm.params, timestamp);
++        addViewUpdateToMutationBuilder(view, builder);
++        announce(builder, announceLocally);
+     }
+ 
 -    private static void addViewUpdateToMutation(ViewDefinition view, Mutation mutation,
long timestamp)
++    private static void addViewUpdateToMutationBuilder(ViewDefinition view, Mutation.SimpleBuilder
builder)
+     {
          view.metadata.validate();
  
          ViewDefinition oldView = Schema.instance.getView(view.ksName, view.viewName);
@@@ -437,9 -457,8 +458,8 @@@
  
          oldView.metadata.validateCompatibility(view.metadata);
  
 -        logger.info(String.format("Update view '%s/%s' From %s To %s", view.ksName, view.viewName,
oldView, view));
 -        SchemaKeyspace.makeUpdateViewMutation(mutation, oldView, view, timestamp);
 +        logger.info("Update view '{}/{}' From {} To {}", view.ksName, view.viewName, oldView,
view);
-         announce(SchemaKeyspace.makeUpdateViewMutation(ksm, oldView, view, FBUtilities.timestampMicros()),
announceLocally);
++        SchemaKeyspace.makeUpdateViewMutation(builder, oldView, view);
      }
  
      public static void announceTypeUpdate(UserType updatedType, boolean announceLocally)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message