This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch cassandra-2.2
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 1caaa9c0b6d49b6394a8c28aac61047e66be50e2
Merge: 3f74a9c 63f4da9
Author: Mick Semb Wever <[email protected]>
AuthorDate: Fri Aug 28 09:32:55 2020 +0200

    Merge branch 'cassandra-2.1' into cassandra-2.2

 CHANGES.txt                                                | 3 ++-
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --cc CHANGES.txt
index 439ef5d,04cbfa3..d6edbe9
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,66 -1,12 +1,67 @@@
 -2.1.22
 +2.2.18
 + * Fix CQL parsing of collections when the column type is reversed 
(CASSANDRA-15814)
- 
++Merged from 2.1:
+  * Only allow strings to be passed to JMX authentication (CASSANDRA-16077)
 - * Disable JMX rebinding (CASSANDRA-15653, CASSANDRA-16075)
  
 -2.1.21
 +2.2.17
 + * Fix nomenclature of allow and deny lists (CASSANDRA-15862)
 + * Remove generated files from source artifact (CASSANDRA-15849)
 + * Remove duplicated tools binaries from tarballs (CASSANDRA-15768)
 + * Duplicate results with DISTINCT queries in mixed mode (CASSANDRA-15501)
 + * Disable JMX rebinding (CASSANDRA-15653)
 + * Fix Commit log replays when static column clustering keys are collections 
(CASSANDRA-14365)
 + * Fix Red Hat init script on newer systemd versions (CASSANDRA-15273)
 + * Allow EXTRA_CLASSPATH to work on tar/source installations (CASSANDRA-15567)
 +Merged from 2.1:
   * Fix writing of snapshot manifest when the table has table-backed secondary 
indexes (CASSANDRA-10968)
   * Fix parse error in cqlsh COPY FROM and formatting for map of blobs 
(CASSANDRA-15679)
 +
 +
 +2.2.16
 + * Fix SELECT JSON output for empty blobs (CASSANDRA-15435)
 + * In-JVM DTest: Set correct internode message version for upgrade test 
(CASSANDRA-15371)
 + * In-JVM DTest: Support NodeTool in dtest
 +
 +
 +2.2.15
 + * Catch non-IOException in FileUtils.close to make sure that all resources 
are closed (CASSANDRA-15225)
 + * Handle exceptions during authentication/authorization (CASSANDRA-15041)
 + * Fix JDK7 compatibility broken in cassandra-2.2 (CASSANDRA-15050)
 + * Support cross version messaging in in-jvm upgrade dtests (CASSANDRA-15078)
 + * Fix index summary redistribution cancellation (CASSANDRA-15045)
 + * Refactor Circle CI configuration (CASSANDRA-14806)
 + * Fixing invalid CQL in security documentation (CASSANDRA-15020)
 + * Make tools/bin/token-generator py2/3 compatible (CASSANDRA-15012)
 + * Multi-version in-JVM dtests (CASSANDRA-14937)
 + * Allow instance class loaders to be garbage collected for inJVM dtest 
(CASSANDRA-15170)
 + * Add support for network topology and query tracing for inJVM dtest 
(CASSANDRA-15319)
 +
 +
 +2.2.14
 + * CircleCI docker image should bake in more dependencies (CASSANDRA-14985)
 + * Don't enable client transports when bootstrap is pending (CASSANDRA-14525)
 + * MigrationManager attempts to pull schema from different major version 
nodes (CASSANDRA-14928)
 + * Don't skip entire sstables when reading backwards with mixed clustering 
column order
 +   (CASSANDRA-14910)
 + * Cannot perform slice reads in reverse direction against tables with 
clustering columns
 +   in mixed order (CASSANDRA-14899)
 + * Fix incorrect cqlsh results when selecting same columns multiple times 
(CASSANDRA-13262)
 + * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 +Merged from 2.1:
   * Paged Range Slice queries with DISTINCT can drop rows from results 
(CASSANDRA-14956)
   * Update release checksum algorithms to SHA-256, SHA-512 (CASSANDRA-14970)
 +
 +
 +2.2.13
 + * Fix bug that prevented compaction of SSTables after full repairs 
(CASSANDRA-14423)
 + * Incorrect counting of pending messages in OutboundTcpConnection 
(CASSANDRA-11551)
 + * Fix compaction failure caused by reading un-flushed data (CASSANDRA-12743)
 + * Use Bounds instead of Range for sstables in anticompaction 
(CASSANDRA-14411)
 + * Fix JSON queries with IN restrictions and ORDER BY clause (CASSANDRA-14286)
 + * CQL fromJson(null) throws NullPointerException (CASSANDRA-13891)
 + * Fix query pager DEBUG log leak causing hit in paged reads throughput 
(CASSANDRA-14318)
 + * Backport circleci yaml (CASSANDRA-14240)
 +Merged from 2.1:
   * Check checksum before decompressing data (CASSANDRA-14284)
   * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt 
(CASSANDRA-14183)
  
diff --cc src/java/org/apache/cassandra/service/CassandraDaemon.java
index 7d85d9d,313cc9d..86e2464
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@@ -33,12 -31,11 +33,13 @@@ import java.rmi.registry.LocateRegistry
  import java.rmi.registry.Registry;
  import java.rmi.server.RMIClientSocketFactory;
  import java.rmi.server.RMIServerSocketFactory;
 +import java.util.Collections;
++import java.util.HashMap;
  import java.util.List;
 -import java.util.*;
 +import java.util.Map;
 +import java.util.UUID;
  import java.util.concurrent.TimeUnit;
  
 -import javax.management.MBeanServer;
  import javax.management.ObjectName;
  import javax.management.StandardMBean;
  import javax.management.remote.JMXConnectorServer;
@@@ -88,63 -79,55 +89,66 @@@ import org.apache.cassandra.utils.*
  public class CassandraDaemon
  {
      public static final String MBEAN_NAME = 
"org.apache.cassandra.db:type=NativeAccess";
 -    public static JMXConnectorServer jmxServer = null;
 +    private static JMXConnectorServer jmxServer = null;
  
 -    private static final Logger logger = 
LoggerFactory.getLogger(CassandraDaemon.class);
 +    private static final Logger logger;
  
 -    private static void maybeInitJmx()
 +    @VisibleForTesting
 +    public static CassandraDaemon getInstanceForTesting()
      {
 -        String jmxPort = 
System.getProperty("com.sun.management.jmxremote.port");
 +        return instance;
 +    }
  
 -        if (jmxPort == null)
 +    static {
 +        // Need to register metrics before instrumented appender is 
created(first access to LoggerFactory).
 +        SharedMetricRegistries.getOrCreate("logback-metrics").addListener(new 
MetricRegistryListener.Base()
          {
 -            logger.warn("JMX is not enabled to receive remote connections. 
Please see cassandra-env.sh for more info.");
 -
 -            jmxPort = System.getProperty("cassandra.jmx.local.port");
 -
 -            if (jmxPort == null)
 +            @Override
 +            public void onMeterAdded(String metricName, Meter meter)
              {
 -                logger.error("cassandra.jmx.local.port missing from 
cassandra-env.sh, unable to start local JMX service." + jmxPort);
 +                // Given metricName consists of appender name in logback.xml 
+ "." + metric name.
 +                // We first separate appender name
 +                int separator = metricName.lastIndexOf('.');
 +                String appenderName = metricName.substring(0, separator);
 +                String metric = metricName.substring(separator + 1); // 
remove "."
 +                ObjectName name = 
DefaultNameFactory.createMetricName(appenderName, metric, null).getMBeanName();
 +                CassandraMetricsRegistry.Metrics.registerMBean(meter, name);
              }
 -            else
 -            {
 -                System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 +        });
 +        logger = LoggerFactory.getLogger(CassandraDaemon.class);
 +    }
  
 -                try
 -                {
 -                    RMIServerSocketFactory serverFactory = new 
RMIServerSocketFactoryImpl();
 -                    Map<String, Object> env = new HashMap<>();
 -                    
env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverFactory);
 -                    env.put("jmx.remote.rmi.server.credential.types",
 -                        new String[] { String[].class.getName(), 
String.class.getName() });
 -                    Registry registry = new 
JmxRegistry(Integer.valueOf(jmxPort), null, serverFactory, "jmxrmi");
 -                    JMXServiceURL url = new 
JMXServiceURL(String.format("service:jmx:rmi://localhost/jndi/rmi://localhost:%s/jmxrmi",
 jmxPort));
 -                    @SuppressWarnings("resource")
 -                    RMIJRMPServerImpl server = new 
RMIJRMPServerImpl(Integer.valueOf(jmxPort),
 -                                                                     null,
 -                                                                     
(RMIServerSocketFactory) 
env.get(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE),
 -                                                                     env);
 -                    jmxServer = new RMIConnectorServer(url, env, server, 
ManagementFactory.getPlatformMBeanServer());
 -                    jmxServer.start();
 -                    
((JmxRegistry)registry).setRemoteServerStub(server.toStub());
 -                }
 -                catch (IOException e)
 -                {
 -                    logger.error("Error starting local jmx server: ", e);
 -                }
 -            }
 +    private void maybeInitJmx()
 +    {
 +        if (System.getProperty("com.sun.management.jmxremote.port") != null)
 +            return;
 +
 +        String jmxPort = System.getProperty("cassandra.jmx.local.port");
 +        if (jmxPort == null)
 +            return;
 +
 +        System.setProperty("java.rmi.server.hostname", 
InetAddress.getLoopbackAddress().getHostAddress());
 +        RMIServerSocketFactory serverFactory = new 
RMIServerSocketFactoryImpl();
-         Map<String, ?> env = 
Collections.singletonMap(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE,
 serverFactory);
++        Map<String, Object> env = new HashMap<>();
++        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, 
serverFactory);
++        env.put("jmx.remote.rmi.server.credential.types",
++            new String[] { String[].class.getName(), String.class.getName() 
});
 +        try
 +        {
 +            Registry registry = new JmxRegistry(Integer.valueOf(jmxPort), 
null, serverFactory, "jmxrmi");
 +            JMXServiceURL url = new 
JMXServiceURL(String.format("service:jmx:rmi://localhost/jndi/rmi://localhost:%s/jmxrmi",
 jmxPort));
 +            @SuppressWarnings("resource")
 +            RMIJRMPServerImpl server = new 
RMIJRMPServerImpl(Integer.valueOf(jmxPort),
 +                                                             null,
 +                                                             
(RMIServerSocketFactory) 
env.get(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE),
 +                                                             env);
 +            jmxServer = new RMIConnectorServer(url, env, server, 
ManagementFactory.getPlatformMBeanServer());
 +            jmxServer.start();
 +            ((JmxRegistry)registry).setRemoteServerStub(server.toStub());
          }
 -        else
 +        catch (IOException e)
          {
 -            logger.info("JMX is enabled to receive remote connections on 
port: " + jmxPort);
 +            exitOrFail(1, e.getMessage(), e.getCause());
          }
      }
  


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to