Commit Graph

19164 Commits

Author SHA1 Message Date
Ekaterina Dimitrova 1e8a1a21ab Fix data corruption in VectorCodec when using heap buffers
patch by Ekaterina Dimitrova, reviewed by Andres de la Pena for CASSANDRA-19168
2024-01-30 16:59:13 -05:00
Caleb Rackliffe 87f2a7b763 Avoid over-skipping of key iterators from static column indexes during mixed intersections
patch by Caleb Rackliffe; reviewed by Piotr Kołaczkowski and Alex Petrov for CASSANDRA-19278

Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@gmail.com>
2024-01-29 09:47:57 -06:00
Stefan Miklosovic c00ebc8d2d
Make concurrent_index_builders configurable at runtime
This work is part of SAI phase 2 as per CASSANDRA-18473

patch by Stefan Miklosovic; reviewed by Caleb Rackliffe for CASSANDRA-19266
2024-01-25 10:12:48 +01:00
Jacek Lewandowski d422eb1f35 Fix storage_compatibility_mode for streaming
- Rename and refactor a bit property for overriding storage compatibility mode
- Fix streaming for tools
- consider bulkloader as a client instead of tool

Patch by Jacek Lewandowski; reviewed by Berenguer Blasi, Branimir Lambov for CASSANDRA-19126
2024-01-23 14:24:06 +01:00
Stefan Miklosovic 016dd6ca37
Make CQLSSTableWriter to support building of SAI indexes
patch by Stefan Miklosovic; reviewed by Caleb Rackliffe, Doug Rohrer for CASSANDRA-18714
2024-01-22 09:59:19 +01:00
Stefan Miklosovic e077c93f0e
Merge branch 'cassandra-4.1' into cassandra-5.0 2024-01-11 11:32:41 +01:00
Stefan Miklosovic fa6e06c933
Merge branch 'cassandra-4.0' into cassandra-4.1 2024-01-11 11:30:25 +01:00
Runtian Liu ee9e418782
Skip version check if an endpoint is dead state in Gossiper#upgradeFromVersionSupplier
patch by Runtian Liu; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-19187
2024-01-11 10:37:11 +01:00
Paulo Motta e04a3176ff Merge branch 'cassandra-4.1' into cassandra-5.0
Closes #3004
2024-01-10 11:21:37 -05:00
Paulo Motta 3d1b981d89 Merge branch 'cassandra-4.0' into cassandra-4.1
Closes #2968
2024-01-10 11:18:34 -05:00
Isaac Reath 475c0035e6 [CASSANDRA-18999] Gossiper::hasMajorVersion3Nodes returns true when a cluster is upgrading patch version without Cassandra 3 nodes.
This commit fixes Gossiper::hasMajorVersion3Nodes so that it does not return true when all hosts have a known version, no hosts are on a version earlier than 4.0, and there is a 4.x minor version or patch version upgrade in progress. Additionally, this commit improves the clarity of Gossiper::hasMajorVersion3Nodes's name to indicate that it will return true when the cluster has 3.x nodes or if the cluster state is unknown, matching the description in the in-line comment.

patch by Isaac Reath; reviewed by Paulo Motta and Stefan Miklosovic for CASSANDRA-18999

Closes #2967
2024-01-10 11:14:49 -05:00
Caleb Rackliffe 14c773d8bc Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Revert unnecessary read lock acquisition when reading ring version in TokenMetadata introduced in CASSANDRA-16286
2024-01-09 15:05:25 -06:00
Caleb Rackliffe 4dd69dc62d Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Revert unnecessary read lock acquisition when reading ring version in TokenMetadata introduced in CASSANDRA-16286
2024-01-09 14:53:51 -06:00
Caleb Rackliffe d5cea135c9 Revert unnecessary read lock acquisition when reading ring version in TokenMetadata introduced in CASSANDRA-16286
patch by Caleb Rackliffe; reviewed by Francisco Guerrero for CASSANDRA-19107
2024-01-09 12:23:13 -06:00
Stefan Miklosovic ad642d5e25
Creating a SASI index after creating an SAI index does not break secondary index queries
patch by Stefan Miklosovic; reviewed by Caleb Rackliffe, Andres de la Peña for CASSANDRA-18939
2024-01-05 11:05:44 +01:00
Stefan Miklosovic 8ce4a6d1ec
Optionally fail when a non-partition-restricted query is issued against an index
patch by Stefan Miklosovic; reviewed by Caleb Rackliffe for CASSANDRA-18796
2024-01-02 10:31:34 +01:00
Jacek Lewandowski 977f245906 Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Memoize Cassandra verion and add a backoff interval for failed schema pulls
2023-12-22 11:49:20 +01:00
Jacek Lewandowski 3edca0041c Memoize Cassandra verion and add a backoff interval for failed schema pulls
Also, fixes MigrationCoordinatorTest and adds version assertions to Instance.startup

Patch by Jacek Lewandowski; reviewed by Ekaterina Dimitrova for CASSANDRA-18902
2023-12-22 11:49:19 +01:00
Jacek Lewandowski f0ea12c6d7 Add a startup check to fail startup when using invalid configuration with certain Kernel and FS type
Patch by Jacek Lewandowski; reviewed by Maxwell Guo, Stefan Miklosovic for CASSANDRA-19196
2023-12-21 16:42:31 +01:00
Mike Adamson 3b05051f86 Simplify segment building in SAI to use single in-memory structure
This removes the RAMStringIndexer for literal indexes and replaces
  it with a SegmentTrieBuffer that replaces BlockBalancedTreeRamBuffer
  for literal and numeric indexes.

patch by Mike Adamson; reviewed by Andrés de la Peña, Caleb Rackliffe for CASSANDRA-18598
2023-12-20 15:14:41 +00:00
Claude Warren e6ffd8b4f7
UCS min_sstable_size should not be lower than target_sstable_size lower bound
patch by Claude Warren; reviewed by Ethan Brown, Branimir Lambov and Stefan Miklosovic for CASSANDRA-19112
2023-12-19 20:26:14 +01:00
Jacek Lewandowski 2fc2be54ca Fix the correspondingMessagingVersion of SSTable format and improve TTL overflow tests coverage
Patch by Jacek Lewandowski; reviewed by Berenguer Blasi for CASSANDRA-19197
2023-12-15 09:40:37 +01:00
Mike Adamson 5ec0669bec Fix resource cleanup after SAI query timeouts
patch by Mike Adamson; reviewed by Caleb Rackliffe for CASSANDRA-19177
2023-12-13 12:20:32 +00:00
Jacek Lewandowski 676f7ee751 Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Fix StackOverflowError on ALTER after many previous schema changes
2023-12-06 18:05:49 +01:00
Abe Ratnofsky a443990bfa Fix StackOverflowError on ALTER after many previous schema changes
Fix re-wrapping of TableMetadataRefCache fields in
Collections.UnmodifiableMap, which was causing long reference chains
where the underlying map was another instance of an UnmodifiableMap.
Calls to `get` had to traverse all the way down the chain, and would
eventually overflow the stack (and created a fair bit of extra garbage
on the heap).

Patch by Abe Ratnofsky; reviewed by Caleb Rackliffe, Jacek Lewandowski for CASSANDRA-19166
2023-12-06 18:05:47 +01:00
Mike Adamson 6a7bef12ec
Fix SAI intersection queries
- Fix comparison in PostingListRangeIterator for updating skip token
 - Fix binary search in KeyLookup.clusteredSeekToKey
 - Added new on-disk component for storing partition sizes by partition ID

 patch by Mike Adamson; reviewed by Caleb Rackliffe, Mick Semb Wever for CASSANDRA-19011
2023-12-01 13:47:43 +01:00
Alex Petrov f46444b628 Remove relocated.shadedad.io.netty.transport.noNative prop
Patch by Alex Petrov, reviewed by Francisco Guerrero for CASSANDRA-19119;
2023-11-30 12:43:40 +01:00
Yifan Cai 9dc0378c2f Merge branch 'cassandra-4.1' into cassandra-5.0 2023-11-30 17:45:45 +08:00
Yifan Cai 350e968565 Merge branch 'cassandra-4.0' into cassandra-4.1 2023-11-30 17:44:07 +08:00
Yifan Cai 50273d98e4 Support max SSTable size in sorted CQLSSTableWriter
patch by Yifan Cai; reviewed by Alex Petrov, Francisco Guerrero, Maxwell Guo for CASSANDRA-18941
2023-11-30 17:39:00 +08:00
Marcus Eriksson 806a395b9c Clone EndpointState before sending GossipShutdown message
Patch by marcuse; reviewed by David Capwell for CASSANDRA-19115
2023-11-30 08:29:05 +01:00
Stefan Miklosovic 0b8f889213
Merge branch 'cassandra-4.1' into cassandra-5.0 2023-11-29 18:36:12 +01:00
Stefan Miklosovic df64a5aa0d
Merge branch 'cassandra-4.0' into cassandra-4.1 2023-11-29 18:34:05 +01:00
Szymon Miężał 9affcf169f
Fix nodetool repair_admin summarize-pending command to not throw exception
Fixed a bug causing the `OpenDataException` being thrown
when executing the `repair_admin summarize-pending` command.
This patch addresses the problem by including a missing composite
in `PendingStats.toComposite`, ensuring proper data conversion.

patch by Szymon Miezal; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-19014
2023-11-29 18:32:53 +01:00
Mike Adamson 3928f2992f
Provide truncate task for SAI
If a table is truncated during the initial build of an index there is a chance that the index build will get interrupted and it won't get marked queryable. This patch provides a truncate task for SAI that marks the index queryable during truncation.

 patch by Mike Adamson; reviewed by Caleb Rackliffe, Michael Semb Wever for CASSANDRA-19032
2023-11-29 13:52:46 +01:00
Stefan Miklosovic 3396ce9f08
Merge branch 'cassandra-4.1' into cassandra-5.0 2023-11-29 12:14:27 +01:00
Stefan Miklosovic c8d6182148
Merge branch 'cassandra-4.0' into cassandra-4.1 2023-11-29 12:12:56 +01:00
Stefan Miklosovic 8dc32c5dd7
Merge branch 'cassandra-3.11' into cassandra-4.0 2023-11-29 12:12:22 +01:00
Stefan Miklosovic 6d7cd61412
Merge branch 'cassandra-3.0' into cassandra-3.11 2023-11-29 12:11:29 +01:00
Stefan Miklosovic c1b12058e7
Do not set RPC_READY to false on transports shutdown in order to not fail counter updates for deployments with coordinator and storage nodes with transports turned off
This is the follow-up commit of CASSANDRA-18935 where we set RPC_READY to false
when transports were shut down in runtime. The problem is that the current logic in StorageProxy.findSuitableEndpoint method,
used for the selection of a leader for counter mutations, is filtering out all endpoints which do not have RPC_READY
set to true. Hence, if there is a deployment of a coordinator node (not joining a ring) and storage nodes which
have transports turned off (e.g. for security reasons), then a coordinator node will select no endpoint as a
counter mutation leader which renders counter mutations impossible.

This change just reverts the original fix which was setting RPC_READY to false when transports were shut down in runtime
(e.g. by nodetool disablebinary).

For trunk (to be 5.1 at time of writing this), there is already TCM in place and the correct fix yet to be implemented
is to decouple from checking RCP_READY state and base it e.g. on JOINED state from TCM perspective. Please follow
CASSANDRA-19103 where this will be addressed.

patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-18935
2023-11-29 12:09:59 +01:00
Amit Pawar 3259bea533 Enable Direct-IO feature for CommitLog files using Java native API's.
Patch by Amit Pawar and Jacek Lewandowski; reviewed by Branimir Lambov and Maxwell Guo for CASSANDRA-18464

Co-authored-by: Amit Pawar <Amit.Pawar@amd.com>
Co-authored-by: Jacek Lewandowski <lewandowski.jacek@gmail.com>
2023-11-29 11:29:23 +01:00
Jacek Lewandowski 3cdf71defe Merge branch 'cassandra-4.1' into cassandra-5.0
* cassandra-4.1:
  Fix filtering system ks sstables for relocation on startup
2023-11-28 18:50:18 +01:00
Jacek Lewandowski 78dd963481 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Fix filtering system ks sstables for relocation on startup
2023-11-28 14:21:16 +01:00
Jacek Lewandowski dece96f21d Fix filtering system ks sstables for relocation on startup
Patch by Jacek Lewandowski; reviewed by Benjamin Lerer for CASSANDRA-18963
2023-11-28 14:20:26 +01:00
Mike Adamson a9e6ed3787
Fix broken indexing tests when using SAI
- This fixes a number of broken tests when the default index is set to SAI
 - Composite partition indexes were being filtered prior to row filtering in the
   index searcher resulting in incorrect results
 - Static and non-static index intersection was failing because static primary keys
   were not comparing correctly against non-static primary keys

 patch by Mike Adamson; reviewed by Andres de la Peña, Michael Semb Wever for CASSANDRA-19034
2023-11-26 12:27:23 +01:00
Mike Adamson 0e42b77c97
Improve code model around IndexContext
- Replace IndexContext with IndexTermType and IndexDefinition
 - Move index specific managers, factories and metrics to StorageAttachedIndex
 - Refactor Expression to explicitly define indexed and unindexed expressions

 patch by Mike Adamson; reviewed by Andres de la Peña, Caleb Rackliffe for CASSANDRA-18166
2023-11-25 09:53:40 +01:00
Ethan Brown 9c6e671434
Fixed bug where UnifiedCompactionTask constructor was calling the wrong base constructor of CompactionTask
patch by Ethan Brown; reviewed by Branimir Lambov, Stefan Miklosovic for CASSANDRA-18757
2023-11-23 16:19:10 +01:00
Andrés de la Peña c26f2a3d69 Fix SAI unindexed contexts not considering CONTAINS KEY
patch by Andrés de la Peña; reviewed by Maxwell Guo and Michael Semb Wever for CASSANDRA-19040
2023-11-23 11:51:52 +00:00
Andrés de la Peña e8fb4b2f63 Ensure that empty SAI column indexes do not fail on validation after full-SSTable streaming
patch by Andrés de la Peña; reviewed by Caleb Rackliffe for CASSANDRA-19017

Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
2023-11-22 15:13:06 +00:00
Andrés de la Peña 91a242fe00 SAI in-memory index should check max term size
patch by Zhao Yang and Andrés de la Peña; reviewed by Zhao Yang for CASSANDRA-18926

Co-authored-by: Zhao Yang <zhaoyangsingapore@gmail.com>
Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
2023-11-20 15:59:55 +00:00