Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Ekaterina Dimitrova 2023-09-12 10:22:23 -04:00
commit 830f88d4ab
10 changed files with 4 additions and 101 deletions

View File

@ -43,7 +43,6 @@
<!-- Config files with not much creativity -->
<exclude name=".asf.yaml"/>
<exclude name="**/cassandra*.yaml"/>
<exclude name="conf/metrics-reporter-config-sample.yaml"/>
<exclude NAME="doc/antora.yml"/>
<exclude name="ide/**/*"/>
<exclude name="pylib/cqlshlib/test/config/sslhandling*.config"/>

View File

@ -1,6 +1,7 @@
5.1
* Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787)
Merged from 5.0:
* Remove metrics-reporter-config dependency (CASSANDRA-18743)
* Fix SAI's SegmentMetadata min and max primary keys (CASSANDRA-18734)
* Remove commons-codec dependency (CASSANDRA-18772)
Merged from 4.1:

View File

@ -236,6 +236,8 @@ Upgrading
You need to explicitly add this section to the old yaml if it does not contain it yet to enable Amazon Corretto Crypto Provider for such node.
New deployments have `crypto_provider` uncommented with DefaultCryptoProvider hence Corretto provider will be installed automatically for corresponding architecture.
- `commitlog_sync_batch_window_in_ms` configuration property in cassandra.yaml was removed. Please ensure your configuration is not using this property.
- The pluggable metrics reporter called metrics-reporter-config is removed. The way that metrics can be exported is
fully covered by the dropwizard metrics library itself, using e.g. CsvReporter. See CASSANDRA-18743 for more details.
Deprecation

View File

@ -53,9 +53,6 @@
# information in cassandra.yaml (such as listen_address).
#-Dcassandra.load_ring_state=true|false
# Enable pluggable metrics reporter. See Pluggable metrics reporting in Cassandra 2.0.2.
#-Dcassandra.metricsReporterConfigFile=file
# Set the port on which the CQL native transport listens for clients. (Default: 9042)
#-Dcassandra.native_transport_port=port

View File

@ -1,41 +0,0 @@
# For details see:
# * http://wiki.apache.org/cassandra/Metrics
# * https://github.com/addthis/metrics-reporter-config
# This is an example file for configuring which metrics should go
# where. The sample sends everything to a flat file for humans to
# poke at. metrics-ganglia or metrics-graphite are more likely to
# operationally useful.
# Some metrics are global for a node (KeyCache capacity) while others
# are broken down by column family or even IP. The sample list
# includes all of the global metrics via a while list. To include
# metrics for the system column family for example add
# "^org.apache.cassandra.metrics.ColumnFamily.system.+".
# Start Cassandra with
# -Dcassandra.metricsReporterConfigFile=metrics-reporter-config.yaml
# for this file to be used. If you are using metrics-ganglia,
# metrics-graphite, or a custom reporter you will also have to add those
# jars to the lib directory. Nothing in this file can affect
# jmx metrics.
console:
-
outfile: '/tmp/metrics.out'
period: 10
timeunit: 'SECONDS'
predicate:
color: "white"
useQualifiedName: true
patterns:
- "^org.apache.cassandra.metrics.Cache.+"
- "^org.apache.cassandra.metrics.ClientRequest.+" # includes ClientRequestMetrics
- "^org.apache.cassandra.metrics.CommitLog.+"
- "^org.apache.cassandra.metrics.Compaction.+"
- "^org.apache.cassandra.metrics.DroppedMessage.+"
- "^org.apache.cassandra.metrics.ReadRepair.+"
- "^org.apache.cassandra.metrics.Storage.+"
- "^org.apache.cassandra.metrics.ThreadPools.+"

View File

@ -24,10 +24,8 @@ clients
* `commitlog_archiving.properties`: set archiving parameters for the
`commitlog`
Two sample configuration files can also be found in `./conf`:
The sample configuration files can also be found in `./conf`:
* `metrics-reporter-config-sample.yaml`: configuring what the
metrics-report will collect
* `cqlshrc.sample`: how the CQL shell, cqlsh, can be configured
== Main runtime properties

View File

@ -71,11 +71,6 @@ Set to false to clear all gossip state for the node on restart.
*Default:* true
== `cassandra.metricsReporterConfigFile=<filename>`
Enable pluggable metrics reporter. Explore pluggable metrics reporting
for more information.
== `cassandra.partitioner=<partitioner>`
Set the partitioner.

View File

@ -1080,13 +1080,3 @@ metrics can be exported to a number of monitoring system a number of
http://metrics.dropwizard.io/3.1.0/getting-started/#other-reporting[built
in] and http://metrics.dropwizard.io/3.1.0/manual/third-party/[third
party] reporter plugins.
The configuration of these plugins is managed by the
https://github.com/addthis/metrics-reporter-config[metrics reporter
config project]. There is a sample configuration file located at
`conf/metrics-reporter-config-sample.yaml`.
Once configured, you simply start cassandra with the flag
`-Dcassandra.metricsReporterConfigFile=metrics-reporter-config.yaml`.
The specified .yaml file plus any 3rd party reporter jars must all be in
Cassandra's classpath.

View File

@ -347,7 +347,6 @@ public enum CassandraRelevantProperties
MEMTABLE_OVERHEAD_SIZE("cassandra.memtable.row_overhead_size", "-1"),
MEMTABLE_SHARD_COUNT("cassandra.memtable.shard.count"),
MEMTABLE_TRIE_SIZE_LIMIT("cassandra.trie_size_limit_mb"),
METRICS_REPORTER_CONFIG_FILE("cassandra.metricsReporterConfigFile"),
MIGRATION_DELAY("cassandra.migration_delay_ms", "60000"),
/** Defines the maximum number of unique timed out queries that will be reported in the logs. Use a negative number to remove any limit. */
MONITORING_MAX_OPERATIONS("cassandra.monitoring_max_operations", "50"),

View File

@ -21,7 +21,6 @@ import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.net.InetAddress;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.file.Files;
import java.nio.file.Path;
@ -40,14 +39,9 @@ import com.google.common.collect.ImmutableList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.addthis.metrics3.reporter.config.ReporterConfig;
import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistryListener;
import com.codahale.metrics.SharedMetricRegistries;
import com.codahale.metrics.jvm.BufferPoolMetricSet;
import com.codahale.metrics.jvm.FileDescriptorRatioGauge;
import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
import org.apache.cassandra.audit.AuditLogManager;
import org.apache.cassandra.auth.AuthCacheService;
@ -99,7 +93,6 @@ import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_CLASS
import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_RMI_SERVER_RANDOM_ID;
import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_VERSION;
import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_VM_NAME;
import static org.apache.cassandra.config.CassandraRelevantProperties.METRICS_REPORTER_CONFIG_FILE;
import static org.apache.cassandra.config.CassandraRelevantProperties.SIZE_RECORDER_INTERVAL;
import static org.apache.cassandra.config.CassandraRelevantProperties.START_NATIVE_TRANSPORT;
@ -380,36 +373,6 @@ public class CassandraDaemon
// Prepared statements
QueryProcessor.instance.preloadPreparedStatements();
// Metrics
String metricsReporterConfigFile = METRICS_REPORTER_CONFIG_FILE.getString();
if (metricsReporterConfigFile != null)
{
logger.info("Trying to load metrics-reporter-config from file: {}", metricsReporterConfigFile);
try
{
// enable metrics provided by metrics-jvm.jar
CassandraMetricsRegistry.Metrics.register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
CassandraMetricsRegistry.Metrics.register("jvm.gc", new GarbageCollectorMetricSet());
CassandraMetricsRegistry.Metrics.register("jvm.memory", new MemoryUsageGaugeSet());
CassandraMetricsRegistry.Metrics.register("jvm.fd.usage", new FileDescriptorRatioGauge());
// initialize metrics-reporter-config from yaml file
URL resource = CassandraDaemon.class.getClassLoader().getResource(metricsReporterConfigFile);
if (resource == null)
{
logger.warn("Failed to load metrics-reporter-config, file does not exist: {}", metricsReporterConfigFile);
}
else
{
String reportFileLocation = resource.getFile();
ReporterConfig.loadFromFile(reportFileLocation).enableAll(CassandraMetricsRegistry.Metrics);
}
}
catch (Exception e)
{
logger.warn("Failed to load metrics-reporter-config, metric sinks will not be activated", e);
}
}
// start server internals
StorageService.instance.registerDaemon(this);
try