Commit Graph

1387 Commits

Author SHA1 Message Date
Paulo Motta 73063437b6 Merge branch 'cassandra-5.0' into trunk 2026-04-08 11:17:44 -04:00
Paulo Motta 9500eb129b Backport Automated Repair Inside Cassandra (CEP-37)
Includes bug fixes and features:
- Improved observability in AutoRepair (CASSANDRA-20581)
- Stop repair scheduler if two major versions detected (CASSANDRA-20048)
- Safeguard Full repair against disk protection (CASSANDRA-20045)
- Stop AutoRepair monitoring thread upon shutdown (CASSANDRA-20623)
- Fix race condition in auto-repair scheduler (CASSANDRA-20265)
- Minimum repair task duration setting (CASSANDRA-20160)
- Preview_repaired auto-repair type (CASSANDRA-20046)
- Gate auto-repair behind cassandra.autorepair.enable JVM property
- Add cassandra.autorepair.check_min_version to gate minimum version enforcement
- Prevent auto-repair from running if any node is below 5.0.7
- Make system_distributed auto-repair schema conditional on feature being enabled
- Add user-friendly errors for disabled auto-repair and schema incompatibility

patch by Paulo Motta; reviewed by Andy Tolbert, Jaydeepkumar Chovatia for CASSANDRA-21138

Co-Authored-By: Andy Tolbert <andy_tolbert@apple.com>
Co-Authored-By: Chris Lohfink <clohfink@netflix.com>
Co-Authored-By: Francisco Guerrero <frankgh@apache.org>
Co-Authored-By: Himanshu Jindal <himanshj@amazon.com>
Co-Authored-By: Jaydeepkumar Chovatia <jchovati@uber.com>
Co-Authored-By: Kristijonas Zalys <kzalys@uber.com>
Co-Authored-By: jaydeepkumar1984 <chovatia.jaydeep@gmail.com>
2026-04-08 10:53:41 -04:00
mck 6590cb5aaf
Change trunk from 5.1 to 6.0
patch by Mick Semb Wever; reviewed by Dmitry Konstantinov for CASSANDRA-21243
2026-03-21 22:55:40 +01:00
mck ee273af1d6
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Add option to disable cqlsh history
2026-03-17 23:09:49 +01:00
mck be0b73ecba
Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Add option to disable cqlsh history
2026-03-17 23:08:14 +01:00
mck ec39ef3193
Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Add option to disable cqlsh history
2026-03-17 23:06:38 +01:00
Ekaterina Dimitrova b47179b7d4
Add option to disable cqlsh history
We can disable saving of the history either via command-line parameter --disable-history, or by setting disabled = True in the history section of the cqlshrc. Both options will read existing history, and just won't save new commands.

Update help and docs for cqlsh history.
Add startup info logline whenr history logging is enabled.
Add a fix for cqlshrc file path not correctly expanding.

Includes the Backport of
  Allows users to change cqlsh history location using env variable
  patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-17448

patch by Ekaterina Dimitrova; reviewed by Mick Semb Wever for CASSANDRA-XXX

Co-authored-by: Alex Ott alex.ott@datastax.com
Co-authored-by: Jaroslaw Grabowski jaroslaw.grabowski@datastax.com
2026-03-17 23:01:57 +01:00
Stefan Miklosovic 43a022c4fc
Implement a guardrail ensuring that minimum training frequency parameter is provided in ZstdDictionaryCompressor
patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21192
2026-03-02 15:52:46 +01:00
Paulo Motta a9ee34b62d Add compaction strategy override via system properties
Introduce the ability to override compaction strategy for specific keyspaces
and tables at startup via two new system properties:
- cassandra.override_compaction.entities: comma-separated list of keyspaces
  and keyspace.table pairs (e.g. "ks1,ks2.tbl1,ks3.tbl2")
- cassandra.override_compaction.params: JSON compaction parameters to apply

Patch by Paulo Motta; Reviewed by Jaydeepkumar Chovatia for CASSANDRA-21169
2026-02-20 11:49:10 -05:00
MichaelMorris 8b6195a975
Upgrade logback version to 1.5.18 and slf4j dependencies to 2.0.17
Dropback of CASSANDRA-20429 to cassandra-5.0

patch by Michael Morris; reviewed by Stefan Miklosovic, Brandon Williams for CASSANDRA-21137
2026-02-06 13:28:03 +11:00
Stefan Miklosovic 3dd460bf34
Remove traces of sampling and auto training for Zstd dictionary compression
This is unnecessary code as the current implementation of CEP-54 is not implemeting / exercising these features.

patch by Stefan Miklosovic; reviewed by Yifan Cai for CASSANDRA-21154
2026-02-05 22:27:18 +11:00
samlightfoot 6f5fe8c06d Add Direct IO support for compaction reads
This change adds support for using O_DIRECT (direct I/O) when reading SSTables
during compaction. Direct I/O bypasses the OS page cache, which can be beneficial
for compaction workloads where data is typically read once and not accessed again
soon after.

Key changes:
- Add DiskAccessMode.direct option for scan operations
- Introduce DirectThreadLocalByteBufferHolder and DirectThreadLocalReadAheadBuffer
  for aligned buffer management required by O_DIRECT
- Add ByteBufferHolder interface to abstract buffer management
- Modify FileHandle to support building direct I/O readers via toBuilder()
- Add startup check to verify Direct IO support on configured data directories
- Enable read-ahead for uncompressed data in Direct CompressedChunkReader
- Move direct IO support logic into FileHandle (from SSTableReader)
- Add comprehensive tests for direct I/O chunk readers and buffer holders

patch by Sam Lightfoot; reviewed by Ariel Weisberg and Maxwell Guo for CASSANDRA-19987
2026-02-04 12:40:42 -05:00
Josh McKenzie 940739a488 Add JDK21 support
Patch by Josh McKenzie; reviewed by Mick Semb Wever and Ekaterina Dimitrova for CASSANDRA-18831

Co-authored-by: Aleksey Yeschenko
Co-authored-by: Achilles Benetopoulos
Co-authored-by: Mick Semb Wever
2026-02-02 12:39:05 -05:00
nickbar01234 585f89bb42
Support custom StartupCheck implementations via SPI
patch by Nick Bar; reviewed by Stefan Miklosovic, Jyothsna Konisa for CASSANDRA-21093

Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2026-02-02 10:12:37 +11:00
ireath 7fe688b000 CASSANDRA-21024: Add configuration to disk usage guardrails to stop writes across all replicas of a keyspace when any node replicating that keyspace exceeds the disk usage failure threshold.
This commit adds a new configuration, data_disk_usage_keyspace_wide_protection_enabled, which ensures that if any node which replicates a given keyspace is full, all writes to that keyspace are blocked.

patch by Isaac Reath; reviewed by Stefan Miklosovic, Paulo Motta for CASSANDRA-20124

Closes #4547
2026-01-21 16:53:54 -05:00
Yaman Ziadeh 7c3c3a1d86 Initial async-profiler Nodetool implementation
patch by Yaman Ziadeh, Bernardo Botella, Stefan Miklosovic; reviewed by Dmitry Konstantinov, Jyothsna Konisa for CASSANDRA-20854
2026-01-12 15:02:13 -08:00
Stefan Miklosovic 98ec8970e1
Move training parameters for Zstd dictionary compression to CQL
It is also possible to override them via nodetool if necessary.

This patch also fixes the computation of sampling ratio to not lose the precision.

patch by Stefan Miklosovic; reviewed by Jyothsna Konisha, Yifan Cai for CASSANDRA-21078
2026-01-07 16:21:47 +01:00
Alan Wang 25390eb8d5 Log queries scanning too many SSTables per read
patch by Alan Wang; reviewed by David Capwell, Marcus Eriksson for CASSANDRA-21048
2025-12-12 14:03:41 -08:00
jkonisa b11633be4f CASSANDRA-20943 Introducing comments and security labels for schema elements 2025-11-19 11:32:50 -08:00
Yuqi Yan e621d8a6c1 Introduce separate GCInspector thresholds for concurrent GC events.
For GC like ShenandoahGC/ZGC etc., there are GC events that do not have STW pauses (Concurrent phases).
Operator might find it reasonable to use lower thresholds for events require STW pauses and higher thresholds for concurrent phases.
gc_concurrent_phase_log_threshold and gc_concurrent_phase_warn_threshold configuration options are introduced in cassandra.yaml

Patch by Yuqi Yan; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-20980
Co-authored-by: Stefan Miklosovic
2025-11-16 21:29:00 +00:00
Yifan Cai 307603a4ad Support ZSTD dictionary compression
patch by Yifan Cai; reviewed by Jon Haddad, Stefan Miklosovic for CASSANDRA-17021
2025-10-30 16:18:37 -07:00
Stefan Miklosovic 035a220d55
Implementation of CEP-55 - Generation of role names
patch by Stefan Miklosovic; reviewed by Bernardo Botella for CASSANDRA-20897
2025-10-23 13:53:56 +02:00
Aparna Naik 61959e215c Add DDL Guardrail enabling administrators to disallow creation/modification of keyspaces with durable_writes = false
patch by Aparna Naik; reviewed by Caleb Rackliffe and Stefan Miklosovic for CASSANDRA-20913
2025-10-02 15:50:31 -05:00
Himanshu Jindal 965a39166c Stop repair scheduler if two major versions are detected
patch by Himanshu Jindal; reviewed by Jaydeepkumar Chovatia, Andy Tolbert for CASSANDRA-20048
2025-09-08 09:26:31 -07:00
Himanshu Jindal daef7b5b98 Safeguard Full repair against disk protection
As per CASSANDRA-20045, we want to prevent full repair against
disk full scenarios. Current protection exists only for incremental
repair. This change updates the config name to not be
incremental repair specific, using the Replace annotation.

patch by Himanshu Jindal; reviewed by David Capwell, Jaydeepkumar Chovatia for CASSANDRA-20045
2025-08-22 14:34:15 -07:00
Paulo Motta b2037e473f
Allow overriding arbitrary settings via environment variables
This also allows overriding complex settings as a JSON value and adds documentation about these overrides to conf/jvm-server.options

patch by Paulo Motta; reviewed by Stefan Miklosovic, David Capwell for CASSANDRA-20749
2025-08-14 19:00:30 +02:00
Stefan Miklosovic 1e5c07af32
Merge branch 'cassandra-5.0' into trunk 2025-07-31 09:22:44 +02:00
Igor Kamyshnikov 7bf6eef9d4
Limit the number of held heap dumps to not consume disk space excessively
patch by Igor Kamyshnikov; reviewed by Dmitry Konstantinov, Stefan Miklosovic for CASSANDRA-20457
2025-06-30 11:34:23 +02:00
jaydeepkumar1984 58d1cc9b1e Increasing default for auto_repair.sstable_upper_threshold considering large Cassandra tables 2025-04-29 09:36:19 -05:00
Nikolay Izhikov fc97fd1037
Upgrade logback version to 1.5.18 and slf4j dependencies to 2.0.17
patch by Nikolay Izhikov; reviewed by Stefan Miklosovic, Maxim Muzafarov, Brandon Williams for CASSANDRA-20429
2025-04-25 14:24:35 +02:00
jaydeepkumar1984 6753fb49dc Automated Repair Inside Cassandra for CEP-37
patch by Jaydeepkumar Chovatia; reviewed by Andy Tolbert, Chris Lohfink, Francisco Guerrero, Kristijonas Zalys for CASSANDRA-19918
2025-04-23 11:04:36 -05:00
Stefan Miklosovic 8fcf309dad
Implement appender of slow queries to system_views.slow_queries table
patch by Stefan Miklosovic; reviewed by Dmitry Konstantinov, Bernardo Botella for CASSANDRA-13001
2025-04-23 09:28:22 +02:00
Ariel Weisberg 6c0ad476ed Miscellaneous migration test fixes
Patch by Ariel Weisberg; Reviewed by David Capwell for CASSANDRA-20060
2025-04-17 11:59:53 -07:00
Benedict Elliott Smith 9ebce5d6df Redesign progress mechanisms to be memory efficient, use fewer messages and to resolve dependency chains promptly.
The SimpleProgressLog had a number of problems:

1. It polled for progress with no attempt to determine whether progress could realistically be made, so:
 - as the number of pending transactions grew, the proportion of useful work dropped (as many would be unable to make progress without earlier transactions completing)
 - each transaction in the chain could recover only on average 1/2 poll interval behind the last transaction to complete
2. It requested full transaction state from every replica on each attempt
3. It maintained a lot of in-memory state
4. Polling happened en-masse, allowing for little per-transaction control

We also separately maintained fairly expensive per-command listener state that negatively affected our command loading and caching.

The new DefaultProgressLog makes use of several new features: LocalListeners, RemoteListeners, Timers and Await messages.
 - LocalListeners provide a memory-efficient collection for managing each CommandStore<E2><80><99>s transaction listeners, with dedicated record keeping for inter-transaction relationships.
 - RemoteListeners provide a mechanism for request/response pairs that may be separated by longer than the normal Cassandra message timeout, and require minimal state on sender and recipient. This permits replicas to cheaply update their local state machine as soon as distributed information becomes available.

The DefaultProgressLog tracks each transaction with separate timers to handle per-transaction scheduling, backoff etc, and a succinct state machine. To reduce overhead correspondence is preferentially limited to a handful of replicas, and limited to the home shard where appropriate.

patch by Benedict; reviewed by Ariel Weisberg for CASSANDRA-19870
2025-04-17 11:59:51 -07:00
Blake Eggleston cb1a05c5d4 Schema based accord fast path configuration
Patch by Blake Eggleston; Reviewed by David Capwell and Alex Petrov for CASSANDRA-19009
2025-04-17 11:59:49 -07:00
Jacek Lewandowski dfd1e99fd1 CEP-15: Add Accord configuration stub
Patch by Jacek Lewandowski; reviewed by David Capwell for CASSANDRA-18221
2025-04-17 11:59:49 -07:00
Blake Eggleston 09c8fa1030 CEP-15 (C*): Messaging and storage engine integration
patch by Blake Eggleston; reviewed by Benedict Elliott Smith, David Capwell for CASSANDRA-17103
2025-04-17 11:59:47 -07:00
Stefan Miklosovic 2e356413ee
Merge branch 'cassandra-5.0' into trunk 2025-03-31 14:35:00 +02:00
Stefan Miklosovic d954c19b21
CASSANDRA-20296 follow-up: by default, explicitly set -XX:MaxDirectMemorySize to half of -Xmx
patch by Stefan Miklosovic; reviewed by Michael Semb Wever for CASSANDRA-20296
2025-03-31 12:55:32 +02:00
Caleb Rackliffe 7b15f477f9 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Prioritize legacy 2i over SAI for columns with multiple indexes
2025-03-13 12:21:09 -05:00
Caleb Rackliffe 740d6d0805 Prioritize legacy 2i over SAI for columns with multiple indexes
patch by Caleb Rackliffe; reviewed by David Capwell for CASSANDRA-20334
2025-03-13 12:15:25 -05:00
maulin-vasavada 37fe4b679c
Provide keystore_password_file and truststore_password_file options to read credentials from a file
patch by Maulin Vasavada; reviewed by Stefan Miklosovic, Maxwell Guo for CASSANDRA-13428
2025-03-04 12:33:41 +01:00
mck 346e096529
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Heap and GC jvm flags improvements
2025-02-22 11:06:00 +01:00
mck 0034a133fa
Heap and GC jvm flags improvements
G1 can rely on `-XX:G1NewSizePercent=50` to always floor the young generation's size to 50% of the heap. (In production this can be raised to 66% for optimal performance.)

Fixing the young generation size with `-Xmn` is only applicable to CMS, so move it to the appropriate section.

When using G1, we can automatically set `-XX:ParallelGCThreads` and `-XX:ConcGCThreads` to the number of system cpu cores.

The auto-generated heap size is now half the server's physical RAM, capped at 16G for CMS and 31G for G1.

Increase MaxTenuringThreshold from 1 to 2, as evidence has shown it has no cost (over values of zero or one), but can have significant benefits in keeping objects in the young generation. While, values above 2 don't have any noticeable benefit.

Always set CASSANDRA_HEAPDUMP_DIR, default it to $CASSANDRA_LOG_DIR, to avoid hprof filling up unexpected disk volumes. Assumption here is that the logs directory is large enough to handle these dumps, and/or operators are monitoring these directories more than other randon/unknown directories.

 patch by Mick Semb Wever; reviewed by Jon Haddad for CASSANDRA-20296
2025-02-22 10:59:42 +01:00
Stefan Miklosovic 0bf51f6e48
Merge branch 'cassandra-5.0' into trunk 2025-02-22 08:07:56 +01:00
Daniel Lenski 027689ae48
Fix unparseable YAML in default cassandra.yaml when uncommented for downstream tooling
The presence of an extra space the `:` in `key: value` pairs
makes the default `conf/cassandra.yaml` file included in
this repository unparseable and non-functional for some downstream tooling.

patch by Daniel Lenski; reviewed by Stefan Miklosovic, Brandon Williams for CASSANDRA-20359
2025-02-22 08:05:23 +01:00
Bernardo Botella Corbi 95180bab15 Adds new size Guardrails
Patch by Bernardo Botella Corbi; Reviewed by Jordan West, Yifan Cai for CASSANDRA-19677
2025-02-17 12:28:55 -08:00
Dmitry Konstantinov d7258ac8f3
Add table metric PurgeableTombstoneScannedHistogram and a tracing event for scanned purgeable tombstones
patch by Dmitry Konstantinov; reviewed by Chris Lohfink, Stefan Miklosovic for CASSANDRA-20132
2025-01-27 22:10:20 +01:00
Abe Ratnofsky aa5b8e3d3f Periodically disconnect roles that are revoked or have LOGIN=FALSE set
patch by Abe Ratnofsky; reviewed by Bernardo Botella Corbi, Francisco Guerrero Hernandez, and Jon Meredith for CASSANDRA-19385
2025-01-14 12:40:44 -08:00
Sam Tunnicliffe 48dcf5e092 Snitch re-implementation
Deprecate IEndpointSnitch entirely, to be replaced with new interfaces:
* Locator for endpoint -> location mapping
* InitialLocationProvider to supply the DC & rack for registration
* NodeProximity for sorting endpoints and replicas at query time

For migration/upgrade/deprecation, nodes can still be configured with
an IEndpointSnitch implementation via endpoint_snitch in config, but
we hide this with a facade and only present the new interfaces.

Patch by Sam Tunnicliffe and Marcus Eriksson; reviewed by Sam
Tunnicliffe and Marcus Eriksson for CASSANDRA-19488

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2024-12-16 11:25:39 +00:00