Commit Graph

8861 Commits

Author SHA1 Message Date
Doug Rohrer 3bc266ca96 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  CASSANDRA-20609 - CQLSSTableWriter should support setting the format (5.0)
2025-05-01 13:50:33 -04:00
Doug Rohrer 2aeb6a0290 CASSANDRA-20609 - CQLSSTableWriter should support setting the format (5.0) 2025-05-01 13:33:57 -04:00
jaydeepkumar1984 58d1cc9b1e Increasing default for auto_repair.sstable_upper_threshold considering large Cassandra tables 2025-04-29 09:36:19 -05:00
Marcus Eriksson 5e003af516 Fix token restrictions with MIN_TOKEN
Patch by marcuse and David Capwell; reviewed by David Capwell for CASSANDRA-20557
2025-04-28 15:51:11 +02:00
Caleb Rackliffe 5b0956be4b Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Ensure RowFilter#isMutableIntersection() properly evaluates numeric ranges on a single column
2025-04-27 10:15:51 -05:00
Caleb Rackliffe 4bcae8e57e Ensure RowFilter#isMutableIntersection() properly evaluates numeric ranges on a single column
patch by Caleb Rackliffe; reviewed by Ariel Weisberg for CASSANDRA-20566
2025-04-27 09:46:59 -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
Dmitry Konstantinov a93f0819e3 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Add LittleEndianMemoryUtil and NativeEndianMemoryUtil, switch memtable-related off-heap objects and Memory to use them and have Little Endian now. Add BE offsets detection on Summary loading. Add test SSTables in an old format with BE offsets in Summary component to LegacySSTableTest.
2025-04-24 12:20:09 +01:00
Dmitry Konstantinov ae82efc013 Add LittleEndianMemoryUtil and NativeEndianMemoryUtil, switch memtable-related off-heap objects and Memory to use them and have Little Endian now.
Add BE offsets detection on Summary loading.
Add test SSTables in an old format with BE offsets in Summary component to LegacySSTableTest.

Patch by Dmitry Konstantinov; reviewed by Branimir Lambov, Michael Semb Wever for CASSANDRA-20190
2025-04-24 11:45:26 +01:00
David Capwell df24dacc0c Merge branch 'cassandra-5.0' into trunk 2025-04-23 18:00:34 -07:00
David Capwell 07831c9cc7 SAI marks an index as non-empty when a partial partition/row modifications is flushed due to repair
patch by David Capwell; reviewed by Caleb Rackliffe for CASSANDRA-20567
2025-04-23 17:58:45 -07:00
Sunil Ramchandra Pawar 97037496f2 SAI fails queries when multiple columns exist and a non-indexed column is a composite with a map
patch by Sunil Ramchandra Pawar; reviewed by Caleb Rackliffe, David Capwell for CASSANDRA-19891
2025-04-23 15:05:54 -07: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
maulin-vasavada bcea8f5815
Refactor EncryptionOptions to use client / server encryption options builders
patch by Maulin Vasavada; reviewed by Maxwell Guo, Stefan Miklosovic for CASSANDRA-20404
2025-04-23 09:27:09 +02:00
Jon Meredith 4805123eb8 Merge branch 'cassandra-5.0' into trunk 2025-04-22 16:08:20 -06:00
Jon Meredith 32cfd477df Merge branch 'cassandra-4.1' into cassandra-5.0 2025-04-22 14:43:49 -06:00
Jon Meredith 2ac701629b Merge branch 'cassandra-4.0' into cassandra-4.1 2025-04-22 14:42:51 -06:00
Jon Meredith d4d858d382 Updating a column with a new TTL but same expiration time is non-deterministic and causes repair mismatches.
patch by Jon Meredith; reviewed by Marcus Eriksson for CASSANDRA-20561
2025-04-22 14:42:02 -06:00
Benedict Elliott Smith 95c6fd481a Serialization improvements
- Share TableMetadatas and PartitionKey for PartialTxn serialization
Also:
 - TxnReference et al should reference uniqueId, and avoid serializing ksName/cfName
 - Don't double count shared keys when estimating size on heap

 patch by Benedict; reviewed by David Capwell for CASSANDRA-20578
2025-04-22 19:49:44 +01:00
Branimir Lambov f327b63db0 Introduce SSTableSimpleScanner for compaction
This removes the usage of index files during compaction and simplifies
and improves the performance of compaction.

patch by Branimir Lambov; reviewed by Sylvain Lebresne for CASSANDRA-20092
2025-04-19 13:21:14 -07:00
Francisco Guerrero 8d16b6b074 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  allow grant permission on virtual keyspaces
2025-04-18 09:31:22 -07:00
Francisco Guerrero b83fef6efa Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  allow grant permission on virtual keyspaces
2025-04-18 09:19:49 -07:00
Francisco Guerrero 60ea852811 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  allow grant permission on virtual keyspaces
2025-04-18 09:16:00 -07:00
Tibor Répási 348ffb0ba0 allow grant permission on virtual keyspaces
Patch by Tibor Répási; reviewed by Francisco Guerrero, Maxwell Guo for CASSANDRA-20171
2025-04-18 09:13:04 -07:00
David Capwell 91f29a1f86 Accord: Hopefully last rebase cleanup
patch by David Capwell; reviewed by Ariel Weisberg for CASSANDRA-20568
2025-04-17 14:57:01 -07:00
Alex Petrov 4cdbb5cf2a Accord: Test fixes
patch by Alex Petrov; reviewed by Benedict Elliott Smith, David Capwell for CASSANDRA-20552
2025-04-17 11:59:56 -07:00
David Capwell 6c6082b5d0 Accord: switch back to 1g heap to keep CI stable
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20553
2025-04-17 11:59:56 -07:00
David Capwell dc841f5481 Fix RouteIndexTest when run with -latest.yaml
patch by David Capwell; reviewed by Ariel Weisberg for CASSANDRA-20549
2025-04-17 11:59:56 -07:00
Benedict Elliott Smith 19048ef570 Improve Journal table key serialization
Also improve:
 - TxnId serialization
 - StoreParticipants serialization
 - compareUnsigned Node.Id for consistency with serialized TxnId

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20546
2025-04-17 11:59:56 -07:00
Alex Petrov 68aea4b15f Fix simulator after rebase
* avoid running python3-dependent tasks when running simulator tasks
  * fix a problem with simulated snitch rebase
  * add a distinction between short-lived daemon threads and infinite loop ones for cases when we need to simulate user-implemented infinite loops

Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20542
2025-04-17 11:59:56 -07:00
Benedict Elliott Smith e87d5e5020 Various fixes and improvements
Improve:
 - InMemoryJournal compaction should simulate files to ensure we compact the same cohorts of records (so shadowing applied correctly)
 - Don't update CFK deps if already known
 - avoid unnecessary heapification of LogGroupTimers
 - begin removal of Guava (mostly unused)
 - consider medium path on fast path delayed
 - add Seekables.indexOf to support faster serialization
 - unboxed Invariant.requires variant
 - AsyncChains.addCallback -> invoke
Fix:
 - Recovery must wait for earlier transactions on shards that have not yet been accepted, even if we recover a fast Stable record on another shard
 - only skip Dep calculation on PreAccept if vote is required by coordinator
 - ReadTracker must slice Minimal the first unavailable collection
 - If PreLoadContext cannot acquire shared caches, still consider existing contents
 - CFK: make sure to insert UNSTABLE into missing array
 - Fix failed task stops DelayedCommandStore task queue processing further tasks
 - short circuit AbstractRanges.equals()
 - Handle edge case where we can take fast/medium path but one of the Deps replies contains a future TxnId
 - update executeAtEpoch when retryInFutureEpoch
 - Fix incorrect validation in validateMissing (should only validate newInfo is not in missing when in witnessedBy; all other additions should be included)

patch by Benedict; reviewed by David Capwell for CASSANDRA-20522
2025-04-17 11:59:56 -07:00
David Capwell 92212b2255 Fix upgrade TTL tests that fail due to improved error detection in cep-15-accord
patch by David Capwell; reviewed by Caleb Rackliffe for CASSANDRA-20535
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith f519538092 Switch to plain Thread for AccordExecutor, and improve testing for ASYNC mode
patch by Benedict; reviewed by David Capwell for CASSANDRA-20521
2025-04-17 11:59:55 -07:00
Alex Petrov 14b6395434 Accord: test fixes and stability improvements
* Fix short accord simulation test (seed 0x6bea128ae851724b), ConcurrentModificationException
  * Increase wait time during closing to avoid Unterminated threads
  * Increase timeouts, improve test stability
  * More descriptive output from CQL test
  * Shorten max CMS delay
  * Improve future handling in config service

Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20440
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith fb05d224e7 Fix:
- Accord Journal purging was disabled
 - remove unique_id from schema keyspace
 - avoid String.format in Compactor hot path
 - avoid string concatenation on hot path; improve segment compactor partition build efficiency
 - Partial compaction should update records in place to ensure truncation of discontiguous compactions do not lead to an incorrect field version being used
 - StoreParticipants.touches behaviour for RX was erroneously modified; should touch all non-redundant ranges including those no longer owned
 - SetShardDurable should correctly set DurableBefore Majority/Universal based on the Durability parameter
 - fix erroneous prunedBefore invariant
 - Journal compaction should not rewrite fields shadowed by a newer record
 - Don't save updates to ERASED commands
 - Simplify CommandChange.getFlags
 - fix handling of Durability for Invalidated
 - Don't use ApplyAt for GC_BEFORE with partial input, as might be a saveStatus >= ApplyAtKnown but with executeAt < ApplyAtKnown

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20441
2025-04-17 11:59:55 -07:00
Alex Petrov 289dbb7a05 Accord repin: turn pruning back on
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20114
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith 890be9c6e5 Fix:
- Decouple command serialization from TableMetadata version; introduce ColumnMetadata ids; gracefully handle missing TableId
 - DataInputPlus.readLeastSignificantBytes must truncate high bits
 - Fix RandomPartitioner accord serialization
 - Fast path stable commits must not override recovery propose/commit decisions regarding visibility of a transaction
 - RejectBefore must mergeMax, not merge, to ensure we maintain epoch and hlc increasing independently
 - Bad commitInvalidate decision
 - consistent filtering for touches and stillTouches
 - ensure TRUNCATE_BEFORE implies SHARD_APPLIED
 - TopologyManager.unsyncedOnly off-by-one error
 - DurabilityQueue should not retry SyncPointErased
 - handle rare case of no deps but none needed
 - not updating CFK synchronously on recovery, which can lead to erroneous recovery decisions for other transactions
 - Don't return partial read response when one commandStore rejects the commit
 - Filter touches/stillTouches consistently
 - WaitingState computeLowEpoch must use hasTouched to handle historic key with no route
Improve:
 - Use format parameters to defer building Invariants.requireArgument string
 - streamline RedundantStatus/RedundantBefore
2025-04-17 11:59:55 -07:00
David Capwell 94f720476e Topology mixup tests should do repairs for host replacement and other required topology changes
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20426
2025-04-17 11:59:55 -07:00
Alex Petrov 03053b14bf Implement Nemesis compactor, improve partial compaction
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20424.
2025-04-17 11:59:55 -07:00
Alex Petrov 2999d8f235 Epoch/Topology Garbage Collection
Patch by Alex Petrov; reviewed by Benedict Elliott Smith CASSANDRA-20347.
2025-04-17 11:59:55 -07:00
David Capwell e3982ce0bb When bootstrap fails the retry field is not populated which leads to a NPE
patch by David Capwell; reviewed by Benedict Elliott Smith for CASSANDRA-20417
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith ab556ab545 InterceptingExecutor.schedule returns a simulator-unsafe Future
patch by Benedict Elliott Smith; reviewed by David Capwell for CASSANDRA-20420
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith 430c55dbc4 Integrate RX with Cassandra Repair, so that repair safely flushes pending topology and other durability requirements.
Also improve:
 - Introduce DurabilityService
 - Retire SyncPoint, replace Barrier with Write and RX
 - MessageType -> enum, restore GetMaxConflict
 - Standardise backoff logic with WaitStrategy
 - improve TimeoutStrategy/RetryStrategy specification strings
 - Forbid KX, remove directKeyDeps
 - Introduce UniqueTimeService, permitting hlc reservations for sync points avoid delay when min TxnId is sufficiently in the past
 - Remove ListStore custom purge logic
Also fix:
 - RejectBefore should reject on both epoch and hlc
 - Do not record sync success for removed nodes
 - Support GlobalDurability detecting no command store to run on
 - Incorrect ballot constructor
 - Serializing 15-bit ballot flags incorrectly
 - TopologyManager.hasEpoch deadlock
 - Computing withOpenEpochs incorrectly, sometimes stopping one epoch short
 - PartitionKey serializer should not depend on schema information that can be erased

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20395
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith a12f0ac9db Accord fixes:
- Bad ArrayBuffers recycling logic
 - RX must ensure dependencies TRANSITIVE_VISIBLE
 - Permit constructing "antiRange" that spans multiple prefixes
 - Not computing range CommandSummary IsDep correctly
 - Truncated commands that aren't shard durable could not repopulate CFK on replay, permitting recovery of another command to make an incorrect decision
 - NPE on async persist of RX (i.e. supplying no callback)
 - NPE in Builder.shouldCleanup when durability is null

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20370
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith 5086846494 Fix:
- Only use persisted RedundantBefore for compaction
 - RouteIndex should index only touches, not Route
 - Flush RangesForEpoch updates to journal immediately, so we do not rely on the command we are processing succeeding
 - DurableBefore updates must wait for the epochs to be known locally
 - Shard.mustWitnessEpoch to support guaranteeing to witness relevant non-topology schema changes
 - We must propagate RedundantBefore RX shard bounds along with epoch syncs
 - Prevent a truncated transaction FetchData infinite loop
 - GC_BEFORE status being overwritten by bootstrappedAt, permitting old transaction state to be resurrected
 - Avoid CFK.maxUniqueHlc read race on bootstrap
 - TopologyManager.awaitEpoch could wait for wrong epoch
 - Journal fsync thread could miss notifications
Also improve:
 - CommandStores uses SearchableRangeList for finding matching stores
 - Refactor RedundantBefore to use a sorted array of TxnId/RedundantStatus pairs (to better fix GC_BEFORE issue)
 - Accord debug keyspace operates on keyspace/table, and sorts correctly by token

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20361
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith e9a0d8ef8e Accord: Serialization Improvements
Improve:
 - Introduce pre/accept fast execution flags
 - Introduce searchable Deps serialization
 - Flatten AccordRoutingKey(s) into single type, using sentinel bits
 - Introduce new fast byte-comparable serialization methods for Token and TableId to support above
Fix:
 - Fix journal re-serialization logic
 - Enable RandomPartitioner for Accord by supporting fixed-width serialization for RouteIndex

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20349
2025-04-17 11:59:55 -07:00
Alex Petrov 1d5146a22e Improve stability of tests with many epochs
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20358
2025-04-17 11:59:55 -07:00
Alex Petrov 67e21ec4ba Fix AccordMigrationTest, preclude possible races in topology propagation
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20316
2025-04-17 11:59:55 -07:00
Benedict Elliott Smith 64c4aa88f5 (Accord) Fix recovery when one shard is committed/stable and another is preaccepted
Also fix:
 - Topology slicing must declare whether we share/slice node ownership (to assist above)
 - CFK.visit removes transitive dependencies too eagerly across epoch change
 - apply cleanup to builder consistently, and construct the same value we would produce by purge (so that replay is idempotent)
 - Invoke ExecuteTxn.LocalExecute callbacks on originating CommandStore
 - misc other minor issues

patch by Benedict; reviewed by Alex Petrov for CASSANDRA-20325
2025-04-17 11:59:55 -07:00