Merge branch 'cassandra-3.0' into cassandra-3.11

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

Branch: refs/heads/cassandra-3.11
Commit: 6220108e687e28b05d7cb0bbd254751f51a0f1d7
Parents: 30412b0 7b9868c
Author: mck <m...@apache.org>
Authored: Tue Jun 13 14:11:15 2017 +1000
Committer: mck <m...@apache.org>
Committed: Tue Jun 13 14:15:03 2017 +1000

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../cassandra/auth/CassandraRoleManager.java       |  4 ++++
 .../apache/cassandra/service/StorageService.java   | 17 +++++++++++------
 3 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6220108e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 2ffa526,26462db..f285ff0
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -74,34 -40,12 +74,35 @@@ Merged from 3.0
   * Propagate row deletions in 2i tables on upgrade (CASSANDRA-13320)
   * Slice.isEmpty() returns false for some empty slices (CASSANDRA-13305)
   * Add formatted row output to assertEmpty in CQL Tester (CASSANDRA-13238)
 - * Legacy caching options can prevent 3.0 upgrade (CASSANDRA-13384)
 + * Prevent data loss on upgrade 2.1 - 3.0 by adding component separator to 
LogRecord absolute path (CASSANDRA-13294)
 + * Improve testing on macOS by eliminating sigar logging (CASSANDRA-13233)
 + * Cqlsh copy-from should error out when csv contains invalid data for 
collections (CASSANDRA-13071)
 + * Fix "multiple versions of ant detected..." when running ant test 
(CASSANDRA-13232)
 + * Coalescing strategy sleeps too much (CASSANDRA-13090)
 + * Faster StreamingHistogram (CASSANDRA-13038)
 + * Legacy deserializer can create unexpected boundary range tombstones 
(CASSANDRA-13237)
 + * Remove unnecessary assertion from AntiCompactionTest (CASSANDRA-13070)
 + * Fix cqlsh COPY for dates before 1900 (CASSANDRA-13185)
 + * Use keyspace replication settings on system.size_estimates table 
(CASSANDRA-9639)
 + * Add vm.max_map_count StartupCheck (CASSANDRA-13008)
 + * Hint related logging should include the IP address of the destination in 
addition to
 +   host ID (CASSANDRA-13205)
 + * Reloading logback.xml does not work (CASSANDRA-13173)
 + * Lightweight transactions temporarily fail after upgrade from 2.1 to 3.0 
(CASSANDRA-13109)
 + * Duplicate rows after upgrading from 2.1.16 to 3.0.10/3.9 (CASSANDRA-13125)
 + * Fix UPDATE queries with empty IN restrictions (CASSANDRA-13152)
 + * Fix handling of partition with partition-level deletion plus
 +   live rows in sstabledump (CASSANDRA-13177)
 + * Provide user workaround when system_schema.columns does not contain entries
 +   for a table that's in system_schema.tables (CASSANDRA-13180)
   * Nodetool upgradesstables/scrub/compact ignores system tables 
(CASSANDRA-13410)
 - * Fix NPE issue in StorageService (CASSANDRA-13060)
 + * Fix schema version calculation for rolling upgrades (CASSANDRA-13441)
  Merged from 2.2:
++ * Nodes started with join_ring=False should be able to serve requests when 
authentication is enabled (CASSANDRA-11381)
 + * cqlsh COPY FROM: increment error count only for failures, not for attempts 
(CASSANDRA-13209)
   * Avoid starting gossiper in RemoveTest (CASSANDRA-13407)
   * Fix weightedSize() for row-cache reported by JMX and NodeTool 
(CASSANDRA-13393)
 + * Fix JVM metric names (CASSANDRA-13103)
   * Honor truststore-password parameter in cassandra-stress (CASSANDRA-12773)
   * Discard in-flight shadow round responses (CASSANDRA-12653)
   * Don't anti-compact repaired data to avoid inconsistencies (CASSANDRA-13153)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6220108e/src/java/org/apache/cassandra/auth/CassandraRoleManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6220108e/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageService.java
index 749c6a9,3bad040..b4878c7
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@@ -190,12 -177,10 +190,13 @@@ public class StorageService extends Not
      private boolean isSurveyMode = 
Boolean.parseBoolean(System.getProperty("cassandra.write_survey", "false"));
      /* true if node is rebuilding and receiving data */
      private final AtomicBoolean isRebuilding = new AtomicBoolean();
 +    private final AtomicBoolean isDecommissioning = new AtomicBoolean();
  
 -    private boolean initialized;
 +    private volatile boolean initialized = false;
      private volatile boolean joined = false;
 +    private volatile boolean gossipActive = false;
+     private final AtomicBoolean authSetupCalled = new AtomicBoolean(false);
 +    private volatile boolean authSetupComplete = false;
  
      /* the probability for tracing any particular request, 0 disables tracing 
and 1 enables for all */
      private double traceProbability = 0.0;
@@@ -691,44 -668,9 +692,45 @@@
                  states.add(Pair.create(ApplicationState.STATUS, 
valueFactory.hibernate(true)));
                  Gossiper.instance.addLocalApplicationStates(states);
              }
+             doAuthSetup();
              logger.info("Not joining ring as requested. Use JMX 
(StorageService->joinRing()) to initiate ring joining");
          }
 +
 +        initialized = true;
 +    }
 +
 +    private void loadRingState()
 +    {
 +        if 
(Boolean.parseBoolean(System.getProperty("cassandra.load_ring_state", "true")))
 +        {
 +            logger.info("Loading persisted ring state");
 +            Multimap<InetAddress, Token> loadedTokens = 
SystemKeyspace.loadTokens();
 +            Map<InetAddress, UUID> loadedHostIds = 
SystemKeyspace.loadHostIds();
 +            for (InetAddress ep : loadedTokens.keySet())
 +            {
 +                if (ep.equals(FBUtilities.getBroadcastAddress()))
 +                {
 +                    // entry has been mistakenly added, delete it
 +                    SystemKeyspace.removeEndpoint(ep);
 +                }
 +                else
 +                {
 +                    if (loadedHostIds.containsKey(ep))
 +                        tokenMetadata.updateHostId(loadedHostIds.get(ep), ep);
 +                    Gossiper.instance.addSavedEndpoint(ep);
 +                }
 +            }
 +        }
 +    }
 +
 +    private boolean isReplacing()
 +    {
 +        if (System.getProperty("cassandra.replace_address_first_boot", null) 
!= null && SystemKeyspace.bootstrapComplete())
 +        {
 +            logger.info("Replace address on first boot requested; this node 
is already bootstrapped");
 +            return false;
 +        }
 +        return DatabaseDescriptor.getReplaceAddress() != null;
      }
  
      /**
@@@ -1081,20 -997,18 +1083,23 @@@
  
      private void doAuthSetup()
      {
-         maybeAddOrUpdateKeyspace(AuthKeyspace.metadata());
+         if (!authSetupCalled.getAndSet(true))
+         {
+             maybeAddOrUpdateKeyspace(AuthKeyspace.metadata());
  
-         DatabaseDescriptor.getRoleManager().setup();
-         DatabaseDescriptor.getAuthenticator().setup();
-         DatabaseDescriptor.getAuthorizer().setup();
-         MigrationManager.instance.register(new AuthMigrationListener());
-         authSetupComplete = true;
+             DatabaseDescriptor.getRoleManager().setup();
+             DatabaseDescriptor.getAuthenticator().setup();
+             DatabaseDescriptor.getAuthorizer().setup();
 -
+             MigrationManager.instance.register(new AuthMigrationListener());
++            authSetupComplete = true;
+         }
      }
  
 +    public boolean isAuthSetupComplete()
 +    {
 +        return authSetupComplete;
 +    }
 +
      private void maybeAddKeyspace(KeyspaceMetadata ksm)
      {
          try


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

Reply via email to