Commit Graph

772 Commits

Author SHA1 Message Date
mck 26bf80706b
Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Add configurable batchlog endpoint strategies
2024-10-15 13:38:12 +02:00
shunsaker b8c5436293
Add configurable batchlog endpoint strategies
Batchlog endpoint strategy was previously only random placements on other racks.  Options now are random_remote, prefer_local, dynamic_remote, and dynamic.

 patch by Shayne Hunsaker; reviewed by Mick Semb Wever, Brandon Williams for CASSANDRA-18120
2024-10-15 13:34:40 +02:00
mck 1defa0851f
Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Use ParameterizedClass for all auth-related implementations
2024-10-09 13:53:48 +02:00
Tiago Alves 2dea5c7588
Use ParameterizedClass for all auth-related implementations
Uses ParameterizedClass for IAuthorizer, INetworkAuthorizer, and
IRoleManager implementations enabling those to be configurable from
parameters specified directly in cassandra.yaml.

Opportunistically makes consistent the initialization and setting of
all auth-related implementations and removes code duplication.

Notes:
 * IInternodeAuthenticator implementations are expected to be set as
   default directly in DatabaseDescriptor instead of done via
   AuthConfig.applyAuth(). This is assumed in tests and client logic.
   For instance ReconnectableSnitchHelperTest fetches this authenticator
   before calling daemonInitialize(). Also, BulkLoader fetches this
   directly when creating an outbound connection.
 * Changing this behavior in BulkLoader causes a cascade of changes.
   First, one would need to add AuthConfig.applyAuth() directly in
   clientInitialize() and then would need to enable all the additional
   classes that this change causes. Long term this might be justified
   as if we're depending on the auth logic to be properly set. However,
   in the context of this change it was decided to postpone further
   changes.
 * Standardize auth-related configurations by using a short-form with
   the class name instead of the full qualified class name containing
   the package name.

 patch by Tiago Alves; reviewed by Mick Semb Wever, Stefan Miklosovic for CASSANDRA-19946
2024-10-09 13:51:51 +02:00
Francisco Guerrero 25291ff3fd Allow configuring log format for Audit Logs
patch by Francisco Guerrero; reviewed by Stefan Miklosovic, Andy Tolbert for CASSANDRA-19792
2024-07-24 15:03:18 -07:00
Stefan Miklosovic 42d18a83e4
Merge branch 'cassandra-5.0' into trunk 2024-07-15 15:52:43 +02:00
Stefan Miklosovic 10a98fe5aa
Merge branch 'cassandra-4.1' into cassandra-5.0 2024-07-15 15:40:22 +02:00
Stefan Miklosovic 98a0b54c40
Support dictionary lookup for CassandraPasswordValidator
patch by Stefan Miklosovic; reviewed by Dinesh Joshi, Francisco Guerrero for CASSANDRA-19762
2024-07-15 11:09:57 +02:00
Stefan Miklosovic d336dda112
CEP-24 Password validation / generation
patch by Stefan Miklosovic; reviewed by Dinesh Joshi, Francisco Guerrero for CASSANDRA-17457
2024-07-08 23:32:09 +02:00
Caleb Rackliffe c33c8ebab4 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Optionally fail writes when SAI refuses to index a term value exceeding a configured maximum size
2024-04-17 11:29:43 -05:00
Caleb Rackliffe 9bfaee91c4 Optionally fail writes when SAI refuses to index a term value exceeding a configured maximum size
patch by Caleb Rackliffe; reviewed by Berenguer Blasi and Stefan Miklosovic for CASSANDRA-19493
2024-04-17 11:12:42 -05:00
Abe Ratnofsky 8d705b31e9
Add new TriggersPolicy configuration to allow operators to disable triggers
patch by Abe Ratnofsky; reviewed by Stefan Miklosovic and Sam Tunnicliffe for CASSANDRA-19532
2024-04-16 11:09:33 +02:00
Caleb Rackliffe 39bd3c2261 Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Optionally avoid hint transfer during decommission
2024-04-08 15:28:06 -05:00
Caleb Rackliffe 0974a3656d Optionally avoid hint transfer during decommission
patch by Paul Chandler; reviewed by Caleb Rackliffe and Brandon Williams for CASSANDRA-19525
2024-04-08 15:22:10 -05:00
Francisco Guerrero a0af41f666 CASSANDRA-18951: Add option for MutualTlsAuthenticator to restrict the certificate validity period
In this commit, we introduce two new optional options for the `server_encryption_options`
and the `client_encryption_options`. The options are `max_certificate_validity_period` and
`certificate_validity_warn_threshold`. Both options can be configured as a duration
configuration parameter as defined by the `DurationSpec` (see CASSANDRA-15234). The resolution
for these new properties is minutes.

When specified, the certificate validation implementation will take that information
and reject certificates that are older than the maximum allowed certificate validity period,
translating into a rejection from the authenticating user.

The `certificate_validity_warn_threshold` option can be configured to emit warnings (log entries)
when the certificate exceeds the validity threshold.

patch by Francisco Guerrero; reviewed by Andy Tolbert, Abe Ratnofsky, Dinesh Joshi for CASSANDRA-18951
2024-03-25 16:58:36 -07:00
Branimir Lambov 28efb63df5 Merge branch 'cassandra-5.0' into trunk 2024-03-07 13:19:16 +02:00
Branimir Lambov 06ed1afc34 Add an optimized default configuration to tests and make it available for new users
This patch adds a new configuration file, cassandra_latest.yaml, which changes
some of the settings to use new features we usually recommend to users,
including:
- Big Trie-Indexed SSTables
- Trie memtables
- Unified Compaction Strategy
- Storage Attached Index
- Off-heap objects memtables
- Direct-write commit log
- No storage compatibility

These changes are applied in new test targets for unit, in-jvm and python dtests that are
run pre-commit. When changes are made to the new config file, python dtest will use it
directly, but unit and in-jvm dtests require updates, respectively, to latest_diff.yaml
and InstanceConfig.java.

patch by Branimir Lambov; reviewed by Berenguer Blasi for CASSANDRA-18753
2024-03-07 11:08:44 +02:00
Stefan Miklosovic 087a4474d8
Remove native_transport_port_ssl
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-19397
2024-02-19 09:24:56 +01:00
Stefan Miklosovic 8bdf2615bc
Merge branch 'cassandra-5.0' into trunk 2024-02-14 15:55:34 +01:00
Stefan Miklosovic 8b037a6c84
Deprecate native_transport_port_ssl
patch by Stefan Miklosovic; reviewed by Abe Ratnofsky, Brandon Williams for CASSANDRA-19392
2024-02-14 15:49:01 +01:00
Andrés de la Peña aa3ee3c7f1 Merge branch 'cassandra-5.0' into trunk 2024-02-08 11:34:27 +00:00
Andrés de la Peña 5b9321eee1 Merge branch 'cassandra-4.1' into cassandra-5.0 2024-02-08 11:33:23 +00:00
Andrés de la Peña 89a8155916 Merge branch 'cassandra-4.0' into cassandra-4.1 2024-02-08 11:11:07 +00:00
Andrés de la Peña 505f5af645 Ensure that repair doesn't exceed repair_session_space by running limiting validation parallelism
patch by Andrés de la Peña; reviewed by David Capwell for CASSANDRA-19336

Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
Co-authored-by: David Capwell <dcapwell@apache.org>
2024-02-08 11:09:21 +00:00
Stefan Miklosovic 82c01d5e0e
Merge branch 'cassandra-5.0' into trunk 2024-01-05 10:38:24 +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
Jyothsna Konisa bfcb21fbeb Set right client auth for creating SSL context in mTLS optional mode
patch by Jyothsna Konisa; reviewed by Francisco Guerrero, Jon Meredith for CASSANDRA-18811
2023-12-19 13:54:28 -07:00
Jacek Lewandowski 08c46d0963 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Fix the correspondingMessagingVersion of SSTable format and improve TTL overflow tests coverage
2023-12-15 09:44:46 +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
Jacek Lewandowski 008c1b397b Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Enable Direct-IO feature for CommitLog files using Java native API's.
2023-11-29 11:48:30 +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
Sam Tunnicliffe ae0842372f Implementation of Transactional Cluster Metadata as described in CEP-21
An overview of the core components can be found in the included
TransactionalClusterMetadata.md

patch by Alex Petrov, Marcus Eriksson and Sam Tunnicliffe; reviewed by
Alex Petrov, Marcus Eriksson and Sam Tunnicliffe for CASSANDRA-18330

Co-authored-by: Marcus Eriksson <marcuse@apache.org>
Co-authored-by: Alex Petrov <oleksandr.petrov@gmail.com>
Co-authored-by: Sam Tunnicliffe <samt@apache.org>
2023-11-24 10:26:08 +00:00
Stefan Miklosovic 4f32cdbf7c
Merge branch 'cassandra-5.0' into trunk 2023-11-16 08:44:00 +01:00
Stefan Miklosovic e1355d7238
Set default disk_access_mode to mmap_index_only
patch by Stefan Miklosovic; reviewed by Paulo Motta, Caleb Rackliffe, Brandon Williams for CASSANDRA-19021
2023-11-15 22:14:21 +01:00
Bereng 0a09c12975 Merge branch 'cassandra-5.0' into trunk
* cassandra-5.0:
  Default to nb instead of nc for sstable formats
2023-11-13 09:29:03 +01:00
Bereng 0e4c2f4bef Default to nb instead of nc for sstable formats
patch by Berenguer Blasi; reviewed by Francisco Guerrero, Jacek Lewandowski, Michael Semb Wever for CASSANDRA-19010
2023-11-13 09:26:11 +01:00
David Capwell c96185f188 Merge branch 'cassandra-5.0' into trunk 2023-09-27 16:22:22 -07:00
David Capwell 164fa7949d Add support for repair coordinator to retry messages that timeout
patch by David Capwell; reviewed by Caleb Rackliffe, Marcus Eriksson for CASSANDRA-18816
2023-09-27 16:21:36 -07:00
Runtian 20d80118ac
Add the ability to disable bulk loading of SSTables
patch by Runtian Liu; reviewed by Stefan Miklosovic, Andres de la Peña and Brandon Williams for CASSANDRA-18781
2023-09-19 13:10:03 +02:00
Stefan Miklosovic 7b89b6018d
Remove commitlog_sync_batch_window_in_ms
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-17161
2023-08-09 20:04:34 +02:00
Andrés de la Peña 7482d88f48 Add guardrail for vector dimensions
patch by Andrés de la Peña; reviewed by Brandon Williams and Maxwell Guo for CASSANDRA-18730
2023-08-09 11:30:38 +01:00
Shailaja Koppu 933137fb14 CIDR filtering authorizer
Patch by Shailaja Koppu, Yifan Cai; Reviewed by Dinesh Joshi, Yifan Cai for CASSANDRA-18592

Co-Authored-By: Yifan Cai <ycai@apache.org>
2023-07-28 20:10:02 -07:00
jkonisa f078c02cb5 Adding Mutual TLS authenticators for client & internode connections
Patch by Jyothsna Konisa & Dinesh Joshi; reviewed by Yifan Cai, Jon Meredith,
Yuki Morishita & Dinesh Joshi for CASSANDRA-18554

Co-Authored-By: Dinesh Joshi <djoshi@apache.org>
2023-07-28 13:54:06 -07:00
ayushis 6ab45971fc
Introduce pluggable crypto providers and default to Amazon Corretto Crypto Provider
patch by Ayushi Singh; reviewed by Stefan Miklosovic, Michael Semb Wever and Maxim Muzafarov for CASSANDRA-18624

Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2023-07-28 12:15:33 +02:00
Caleb Rackliffe 394d4b1168 Add support for index implementation selection via USING for CREATE INDEX
patch by Caleb Rackliffe; reviewed by Maxwell Guo and Andres de la Peña for CASSANDRA-18615
2023-07-26 13:35:07 -05:00
Mike Adamson e5e0f3a844 Literal on-disk index and index write path (#9)
This commit contains the following additions
 to SAI:
 - The index write path and index building
   based around StorageAttachedIndexBuilder
   and StorageAttachedIndexWriter
 - The on-disk index versioning using the
   SSTable Descriptor analog IndexDescriptor
   with Version and OnDiskFormat
 - The literal on-disk index using the
   LiteralIndexWriter

patch by Mike Adamson; reviewed by Caleb Rackliffe and Andres de la Peña for CASSANDRA-18062

Co-authored-by: Mike Adamson <mikeatdot@gmail.com>
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Andres de la Peña <a.penya.garcia@gmail.com>
Co-authored-by: Piotr Kołaczkowski <pkolaczk@gmail.com>
Co-authored-by: Jason Rutherglen <jason.rutherglen@gmail.com>
2023-07-26 13:35:07 -05:00
Stefan Miklosovic c273017b25
Add AzureSnitch
As we were implementing the snitch itself, we noticed that the constructors
for cloud-based snitches are unnecessarilly complicated and
we took the opportunity to make them simpler.

patch by Stefan Miklosovic; reviewed by German Eichberger and Jacek Lewandowski for CASSANDRA-18646
2023-07-20 21:35:07 +02:00
Branimir Lambov 957eca2fb5 Implementation of the Unified Compaction Strategy as described in CEP-26
The approach is documented in the included UnifiedCompactionStrategy.md.

Also included:
- Generalize prettyPrint to prettyPrintBinary (with 2^10 multiplier,
  e.g. MiB) and prettyPrintDecimal (with 1000 multiplier, e.g. ms)
  that cover the full range of double, and add a parseHumanReadable
  method that can read both.

- CASSANDRA-18123: Fix invalid reuse of metadata collector during flushing

- Fix invalid token range splitting with non-unit weights

- Add flushSizeOnDisk metric

- Add ability to change compaction default in YAML

patch by Alex Sorokoumov, Branimir Lambov, Dimitar Dimitrov and Stefania Alborghetti
reviewed by Alex Sorokoumov, Jaroslaw Grabowski and Maxwell Guo for CASSANDRA-18397
2023-07-19 11:22:32 +03:00
Daniel Jatnieks aac070681b Disable the deprecated keyspace/table thresholds and convert them to guardrails
patch by Daniel Jatnieks; reviewed by Andrés de la Peña and Brandon Williams for CASSANDRA-18617
2023-07-14 12:23:04 +01:00
Stefan Miklosovic 903857b4ef
Deprecate CloudstackSnitch and remove duplicate code in snitches
The patch also refactors existing cloud snitches to get rid of the duplicate code,
this is the logical follow-up of CASSANDRA-16555 where AbstractCloudMetadataServiceConnector was introduced.

patch by Stefan Miklosovic; reviewed by Jacek Lewandowski, Jackson Fleming and Maxwell Guo for CASSANDRA-18438
2023-07-14 12:38:30 +02:00
Andrés de la Peña c579faa488 Remove deprecated compaction_tombstone_warning_threshold and compaction_large_partition_warning_threshold from yaml
patch by Andrés de la Peña; reviewed by Brandon Williams for CASSANDRA-18626
2023-06-28 21:50:15 +01:00
Bereng 1adbea5a06 Extend maximum expiration date
patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-14227
2023-06-05 07:18:34 +02:00
Andrés de la Peña b72da02611 Add guardrail for partition tombstones and deprecate compaction_tombstone_warning_threshold
patch by Andrés de la Peña; reviewed by Berenguer Blasi and Maxwell Guo for CASSANDRA-17194
2023-06-01 10:56:40 +01:00
Jacek Lewandowski f16fb6765b Implementation of the trie-indexed SSTable format (BTI) as described in CEP-25.
Documentation in the included BTIFormat.md.

patch by Branimir Lambov and Jacek Lewandowski; reviewed by Caleb Rackliffe and Maxwell Guo for CASSANDRA-18398
2023-05-29 16:59:05 +03:00
Andrés de la Peña b0aa44b27d Add guardrail for partition size and deprecate compaction_large_partition_warning_threshold
patch by Andrés de la Peña; reviewed by Berenguer Blasi and Maxwell-Guo for CASSANDRA-18500
2023-05-25 17:49:47 +01:00
Marcus Eriksson f36fd33e33 Merge branch 'cassandra-4.1' into trunk 2023-05-25 08:43:27 +02:00
Marcus Eriksson 72fc04d238 Merge branch 'cassandra-4.0' into cassandra-4.1 2023-05-25 08:43:15 +02:00
Marcus Eriksson aafb4d1944 Improve nodetool enable{audit,fullquery}log
Patch by marcuse; reviewed by Dinesh Joshi and Mick Semb Wever for CASSANDRA-18550
2023-05-25 08:41:12 +02:00
Jacek Lewandowski fe0e04c231 Fix sstable formats configuration
- refactored sstable format configuration
- sstable formats are discovered via ServiceLoader
- options configuration for sstable formats can be included in yaml
- yaml may include selected sstable format and version (version is not yet supported)
- auto saved caches refactored - they include additional metadata component which contains necessary mappings

patch by Jacek Lewandowski; reviewed by David Capwell for CASSANDRA-18441
2023-05-18 12:54:08 +02:00
Jordan West 2ff1ad4788 Add Timestamp Bound Guardrail (bound user supplied timestamps within a certain range)
Patch by Jordan West; Reviewed by Andrés de la Peña and Brandon Williams for CASSANDRA-18352
2023-05-17 13:06:27 -07:00
Lorina Poland 998a98eae8
Reorganizing doc directories using new info arch
patch by Lorina Poland; reviewed by Mick Semb Wever, Štefan Miklošovič for CASSANDRA-18228
2023-04-29 17:59:24 +02:00
Stefan Miklosovic 531b4cde43
Merge branch 'cassandra-4.1' into trunk 2023-04-17 10:40:52 +02:00
Maulin Vasavada bd49f6ff26
Allow keystore and truststore passwords to be nullable
patch by Maulin Vasavada; reviewed by Stefan Miklosovic and Caleb Rackliffe for CASSANDRA-18124
2023-04-14 14:02:51 +02:00
Andrés de la Peña 2e2a49fcdc CEP-20: Dynamic Data Masking
Allows to attach the native masking functions and UDFs to the definitions of
table columns in the schema, as defined by CEP-20.

The functions masking a column can be specified on CREATE TABLE queries, right
at the end of the column definition. The mask of a column can also be changed
or dropped with an ALTER TABLE query. Once a column is masked, SELECT queries
will always return the masked value of the column. That masking is done on the
coordinator, at the end of the query execution. Thus, masking won't affect any
filters or ordering, which would be based on the clear values of the masked
columns. Column masks are stored on the table system_schema.column_masks.

A new UNMASK permission allows to see the clear data of columns with an
attached mask. Also, a new SELECT_MASKED permission allows to run SELECT
queries restricting the clear values of masked columns. Superusers have both
permissions by default, whereas regular users don't have them.

Dynamic data masking can be enabled/disabled with the config property
dynamic_data_masking_enabled in cassandra.yaml. It is disabled by default.

This is the combination of multiple tickets:

 * Add masking functions to column metadata (CASSANDRA-18068)
 * Add UNMASK permission (CASSANDRA-18069)
 * Add SELECT_MASKED permission (CASSANDRA-18070)
 * Add support for using UDFs as masking functions (CASSANDRA-18071)
 * Add feature flag for dynamic data masking (CASSANDRA-18316)

patch by Andrés de la Peña; reviewed by Benjamin Lerer and Berenguer Blasi for CASSANDRA-17940
2023-03-24 13:57:18 +00:00
Jacek Lewandowski b7e1e44a90 SSTable format API
Summary of the changes:

Format, reader and writer
---------------------------
There are a lot of refactorings around sstable related classes aiming to extract the most generic functionality to the top-level entities and push down implementation-specific stuff to the actual implementation. In Particular, the top-level, implementation agnostic classes/interfaces are SSTableFormat interface, SSTable, SSTableReader, SSTableWriter, IVerifier, and IScrubber. The rest of the codebase has been reviewed for explicit usages of big table format-specific usages of sstable classes and refactored. SSTable, SSTableReader, and SSTableWriter have their builders. Builders make a hierarchy that follows the same inheritance structure as readers and writers.

There are also partial implementations that add support for some features and may or may not be used by the custom implementations. They include:
- AbstractSSTableFormat - adds an implementation of some initialization methods - in practice, all of the format implementations should extend this class
- SSTableReaderWithFilter - add support for Bloom filter to the reader
- SortedTableWriter - generic implementation for a writer which writes partitions in the default order to the data file, supports Bloom filter and some index of partitions
- IndexSummarySupport - interface implemented by the readers using index summaries
- KeyCacheSupport - interface implemented by the readers using row key cache

Descriptor
---------------------------
Refactored the Descriptor class so that:
- All paths are created from the base directory File rather than from a String
- All the methods named *filename* producing full paths were made private; their current implementations are returning file names rather than paths (the naming was inconsistent)
- The usages of the `filenameFor` method were refactored to use the `fileFor` method
- The usages of the `fromFilename` method were refactored to use a  `fromFileWithComponent(..., false).left` expression
In essence, the Descriptor class is no longer working on String-based paths.

Index summaries
---------------------------
Removed the index summary from the generic SSTableReader class and created an interface IndexSummarySupport to be implemented by the readers that need it. Methods in related classes that refer back to the reader were refactored to support just readers of the SSTableReader & IndexSummarySupport type. Therefore, we will no longer need to assume that the generic SSTableReader has anything to do with an index summary.

A new IndexSummaryComponent class encloses data fields from the index summary file (note that aside from the index summary itself, the file includes the first and last partition of the sstable). The class has been extracted to deal with those fields and have that logic in a single place.

Filter
---------------------------
Refactored IFilter and its serialization - in particular, added the `serialize` method to the IFilter interface and moved loading/saving logic to a separate utility class FilterComponent.
Extracted the SSTableReaderWithFilter abstract reader extending the generic SSTableReader with filter support.
Extracted bloom filter metrics into separate entities allowing to plug them in if the implementation uses a filter.

Cache
---------------------------
Refactored CacheService to support different key-cache values. CacheService now supports arbitrary IRowIndexEntry implementation as a key-cache value. A new version of the auto-saving cache was created ("g") because some information about the type of serialized row index entry needs to be known before it is deserialized (or skipped). Therefore, the SSTableFormat type ordinal number is stored, which is sufficient because the IRowIndexEntry serializer is specific to the sstable format type.
Similarly to the IndexSummarySupport, a new KeyCacheSupport interface has to be implemented to mark the reader as supporting key-cache. It contains the default implementation of several methods the rest of the system relies on when the key-cache is supported.

Other changes
---------------------------
- Fixed disabling chunk cache - enable(boolean) method in ChunkCache does not make any sense - it makes a false impression it can disable chunk cache once enabled, while in fact, it only clears it. Added setFileCacheEnabled to DatabaseDescriptor

- Made WrappingUnfilteredRowIterator an interface

- DataInputStreamPlus extends InputStream - this makes it possible for input stream-based inheritors of DataInputPlus to extend DataInputStreamPlus. It simplifies coding because sometimes we want to get DataInputPlus implementation extending InputStream as an argument.

- Table and keyspace metrics were made pluggable - in particular, added the ability for a certain format to register gauges that are specific only to that format and make no sense for others

- Implemented mmapped region extension for compressed data

- Refactored FileHandle so that it is no longer closable

- Implemented WrappingRebufferer

- Introduced the SSTable.Owner interface to make SSTable implementation not reference higher-level entities directly. SSTable accepts passing null as the owner when there is no owner (like sometimes in offline tools) or passing a mock when needed in tests.

Individual commits
---------------------------

[4a87cd36fe] Fix disabling chunk cache
[c84c75ccf3] Made WrappingUnfilteredRowIterator an interface
[253d2b828e] Add getType to SSTableFormat
[3f169dcc20] Remove getIndexSerializer from SSTableFormat
[05bae1833b] Pull down rowIndexEntrySerializer field
[da675f2809] Moved RowIndexEntry
[673f0c5c39] Reduce usages of RowIndexEntry
[c72538be91] Refactor CacheService to support for different key cache values
[54d33ee656] Minor refactoring of ColumnIndex
[93862df967] Just moved AbstractSSTableIterator to o.a.c.io.sstable.format
[9e4566a1de] Refactored AbstractSSTableIterator
[a4e61e80bb] Extracted IScrubber and IVerifier interfaces
[20f78c7419] Push down implementation of SSTableReader.firstKeyBeyond
[f2c24e5774] Moved SSTableReader.getSampleIndexesForRanges to IndexSummary
[b6c3a6c1ea] Moved SSTableReader.getKeySamples implementation to IndexSummary
[c4b90ebb33] Refactor InstanceTidier so that it is more generic
[918d5a9e74] Refactor dropping page cache
[a52fb4d558] Refactor sstable metrics
[f6d10f930f] NEW (fix up) - DataInputStreamPlus extends InputStream
[8f6a56d972] Getting rid of index summary in SSTableReader
[4a918bf725] Removed direct usages of primary index from SSTableReader
[358fa32602] Refactor KeyIterator so that it is sstable format agnostic
[14c09d89c2] Remove explicit usage of Components outside of format specific classes
[feff14e137] Move clone methods implementation from SSTableReader to BigTableReader
[64e9787b10] Move saveIndexSummary and saveBloomFilter to SSTableReaderBuilder
[ae71fe6ed8] Moved indexSummary field to BigTableReader and made it private
[df9fd8c4b9] Moved ifile field to BigTableReader and made it private
[2be6ea9ecf] Moved static open methods for BigTableReader to the reader factory
[bc0e55ac48] Minor refactoring around IFilter and its serialization
[5b95704beb] Minor refactorings around IndexSummary
[87812335e8] Extracted TOCComponent class to deal with TOC file
[fdad092a6a] Extracted CompressionInfoComponent class
[39b47e388d] Extracted StatsComponent as a helper for elements of SSTable metadata
[cdb55bff47] Fix SSTable.getMinimalKey
[b99c6d5805] Refactor FileHandle so that it is no longer closable
[77b7f7ace5] Implement WrappingRebufferer
[b6868914dd] Add progressPercentage to ProgressInfo
[7fd4956e5b] Moved copy/rename/hardLink methods from SSTableWriter to SSTable
[1ccc6bf148] Create generic SSTableBuilder and IOOptions
[da58a81102] Refactor SSTableReaderBuilder
[4501ddba1c] Refactor ColumnIndex
[d4f9e1a64b] Extracted non-big-table-specific functionality from BigTableWriter to SortedTableWriter
[379525d01e] Refactor BigTableZeroCopyWriter to SSTableZeroCopyWriter as it is not specific to big format
[8ac37f83bc] Extract EmptySSTableScanner out from BigTableScanner
[ee6673f1cf] Implement SSTableWriterBuilder
[bb26629235] Refactor opening early / final
[a327595015] Refactored SSTableWriter factory
[16ffd7334b] Extract non-big-format-specific logic from scrubber and verifier
[75e02db6af] Allow to specify the default SSTableFormat via system property
[a7b9d0d628] Small fixes around streaming
[407f977c36] Move guard collection size
[0529e57d2f] Remove explicit references to big format
[61509963ec] Unclassified minor changes
[da28d1af3a] Replaced getCreationTimeFor(Component) with getDataCreationTime()
[e99c834de6] !!! Reformatting
[882b7baa5a] Rename SSTableReader.maybePresent and fix its redundant usages
[b70c983bea] Implement mmapped region extension for compressed data
[d7ff3970de] Introduce SSTable.Owner interface
[e9feb9c462] Replaced getCreationTimeFor(Component) with getDataCreationTime()
[ee8082fb07] Created SSTableFormat.deleteOrphanedComponents
[e62950fd3d] Refactor metrics further
[cefa5b3814] Extract key cache support into separate entity
[dd55101ca1] Extracted SSTableReaderWithFilter
[510b651824] Implement customizable component types
[2be512d9fa] Pluggable SSTableFormat by making SSTableFormat.Type not an enum
[670836b55d] Refactor CRC and digest validators
[00c91103bc] Extract delete method to delete SSTables and purge row cache entries
[0819dc9fc2] Extracted trySkipFileCacheBefore(key) to SSTableReader
[732f841750] Added missing overrides in ForwardingSSTableReader
[db623218fd] Update DatabaseDescriptorRefTest
[c018c468e5] Cleanup
[eafc836242] Add @SuppressWarnings("resource") where needed
[3b7c911dd6] Documentation

patch by Jacek Lewandowski, reviewed by Branimir Lambov for CASSANDRA-17056

Co-authored-by: @jacek-lewandowski
Co-authored-by: @blambov
2023-03-06 09:17:18 +01:00
Ekaterina Dimitrova a0ec0ae303 Remove scripted UDFs, remove related tests or rewrite some tests to create java UDFs instead, where it makes sense
patch by Ekaterina Dimitrova; reviewed by Michael Semb Wever for CASSANDRA-18252
2023-02-12 10:18:29 -05:00
Brandon Williams bcaa1dca0b Fix typo in cassandra.yaml CASSANDRA-18209 2023-01-31 06:32:24 -06:00
Nikita Eshkeev f27790c969 Improve and clean up documentation and fix typos
This patch includes all the changes from the PRs that introduce small
changes related to typos and similar in the documentation. The changes are
accumulated from the following PRs:

- https://github.com/apache/cassandra/pull/206
- https://github.com/apache/cassandra/pull/359
- https://github.com/apache/cassandra/pull/366
- https://github.com/apache/cassandra/pull/390
- https://github.com/apache/cassandra/pull/450
- https://github.com/apache/cassandra/pull/567
- https://github.com/apache/cassandra/pull/615
- https://github.com/apache/cassandra/pull/618
- https://github.com/apache/cassandra/pull/746
- https://github.com/apache/cassandra/pull/984
- https://github.com/apache/cassandra/pull/1052
- https://github.com/apache/cassandra/pull/1088
- https://github.com/apache/cassandra/pull/1274
- https://github.com/apache/cassandra/pull/1378
- https://github.com/apache/cassandra/pull/1404
- https://github.com/apache/cassandra/pull/1504
- https://github.com/apache/cassandra/pull/1540
- https://github.com/apache/cassandra/pull/1544
- https://github.com/apache/cassandra/pull/1673
- https://github.com/apache/cassandra/pull/1697
- https://github.com/apache/cassandra/pull/1722
- https://github.com/apache/cassandra/pull/1815
- https://github.com/apache/cassandra/pull/1830
- https://github.com/apache/cassandra/pull/1863
- https://github.com/apache/cassandra/pull/1865
- https://github.com/apache/cassandra/pull/1879
- https://github.com/apache/cassandra/pull/2062

patch by Nikita Eshkeev, reviewed by Stefan Miklosovic, Lorina Poland, Michael Semb Wever for CASSANDRA-18185

Co-authored-by: kalmant <kalmant@users.noreply.github.com>
Co-authored-by: Dmitry <xotonic@yandex.ru>
Co-authored-by: Tibor Répási <rtib@users.noreply.github.com>
Co-authored-by: Tzach Livyatan <tzach@scylladb.com>
Co-authored-by: Jérôme BAROTIN <jeromebarotin@gmail.com>
Co-authored-by: Giorgio Giuffrè <giorgiogiuffre23@gmail.com>
Co-authored-by: Siddhartha Tiwari <201851127@iiitvadodara.ac.in>
Co-authored-by: Angelo Polo <language.devel@gmail.com>
Co-authored-by: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com>
Co-authored-by: 陳傑夫 <chienfuchen32@gmail.com>
Co-authored-by: Bhouse99 <bhouse99@protonmail.com>
Co-authored-by: Matthew Hardwick <MatthewRHardwick@gmail.com>
Co-authored-by: Paul Wouters <paul.wouters@aiven.io>
Co-authored-by: Romain Hardouin <romain_hardouin@yahoo.fr>
Co-authored-by: Guilherme Poleto <gpoleto@alunos.utfpr.edu.br>
Co-authored-by: 陳傑夫 <chienfuchen32@gmail.com>
Co-authored-by: etc-crontab <jujut@free.fr>
Co-authored-by: Prashant Bhuruk <prashantbhuruk88@gmail.com>
Co-authored-by: Jingchuan Zhu <56401528+codingswag998@users.noreply.github.com>
Co-authored-by: Ryan Stewart <ryan.stewart@rackspace.com>
Co-authored-by: utkarsh-agrawal-jm <107914361+utkarsh-agrawal-jm@users.noreply.github.com>
Co-authored-by: Ben Dalling <b.dalling@locp.co.uk>
Co-authored-by: Terry L. Blessing <tlblessing1@gmail.com>
Co-authored-by: gruzilkin <gruzmob@gmail.com>
Co-authored-by: Kevin <kevin.xgr@gmail.com>
Co-authored-by: yziadeh <121903189+yziadeh@users.noreply.github.com>
Co-authored-by: Lorina Poland <lorina@datastax.com>
Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2023-01-26 14:42:47 +01:00
ben b07c3127cc SimpleSeedProvider can resolve multiple IP addresses per DNS record
patch by Ben Bromhead; reviewed by Stefan Miklosovic and Andrés de la Peña for CASSANDRA-14361

Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
2023-01-18 10:43:45 +01:00
David Capwell 7df4530882 Merge branch 'cassandra-4.1' into trunk 2023-01-12 09:48:04 -08:00
David Capwell 5be1038c5d Streaming progress virtual table lock contention can trigger TCP_USER_TIMEOUT and fail streaming
patch by David Capwell; reviewed by Abe Ratnofsky, Jon Meredith for CASSANDRA-18110
2023-01-12 09:46:54 -08:00
Stefan Miklosovic 797b96958a Implement a guardrail for not having zero default_time_to_live on tables with TWCS
patch by Stefan Miklosovic; reviewed by Andrés de la Peña, Josh McKenzie, Brandon Williams and Brad Schoening for CASSANDRA-18042

Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
2022-12-02 09:45:02 +01:00
maxwellguo ee8b66da8c Make incremental backup configurable per table
patch by Maxwell Guo; reviewed by Stefan Miklosovic and Benjamin Lerer for CASSANDRA-15402
2022-11-19 10:57:54 +01:00
Andrés de la Peña 9f99e72aae Add reasons to guardrail messages and consider guardrails in the error message for needed ALLOW FILTERING
* Add optional reason for guarding an operation to every guardrail

* Add reason for disabling ALLOW FILTERING into cassandra.yaml

* Consider allow_filtering_enabled guardrail in the error message for needed ALLOW FILTERING

patch by Andrés de la Peña; reviewed by Berenguer Blasi and Josh McKenzie for CASSANDRA-17967
2022-11-18 13:08:31 +00:00
Jyothsna Konisa 36e16ee3c9 Adding endpoint verification option to client_encryption_options
patch by Jyothsna Konisa; reviewed by Jon Meredith, Yifan Cai for CASSANDRA-18034
2022-11-15 16:06:21 -08:00
Mick Semb Wever 0778ae362c
Merge branch 'cassandra-4.1' into trunk
* cassandra-4.1:
  Restore streaming_keep_alive_period functionality on the netty control streaming channel
2022-11-09 11:47:16 +01:00
Aleksey Yeschenko c100d34a1a
Restore streaming_keep_alive_period functionality on the netty control streaming channel
patch by Aleksey Yeschenko, Mick Semb Wever; reviewed by Mick Semb Wever, Berenguer Blasi for CASSANDRA-17768

Co-authored-by: Aleksey Yeschenko <aleksey@apache.org
Co-authored-by: Mick Semb Wever <mck@apache.org>
2022-11-09 11:39:07 +01:00
Abe Ratnofsky 230fe8e647 Include Git SHA in --verbose flag for nodetool version
Patch by Abe Ratnofsky; review by Brandon Williams, Caleb Rackliffe, Michael Semb Wever and Stefan Miklosovic for CASSANDRA-17753
2022-10-25 21:28:29 +02:00
Caleb Rackliffe d6aee7e08c Optionally avoid hint transfer during decommission
patch by Caleb Rackliffe; reviewed by Jon Meredith and Stefan Miklosovic for CASSANDRA-17808
2022-09-08 16:35:09 -05:00
Andrés de la Peña 4b7069c06c Add guardrail for column size
patch by Andrés de la Peña; reviewed by Ekaterina Dimitrova and David Capwell for CASSANDRA-17151
2022-08-16 17:33:01 +01:00
Josh McKenzie 3e0b94565a Add support to generate a One-Shot heap dump on unhandled exceptions
Patch by Caleb Rackliffe; reviewed by Josh McKenzie, David Capwell, and Jon Meredith for CASSANDRA-17795

Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Josh McKenzie <jmckenzie@apache.org>
2022-08-15 10:48:29 -04:00
Ekaterina Dimitrova 62ac5da78a Merge branch 'cassandra-4.1' into trunk 2022-08-01 20:43:08 -04:00
Ekaterina Dimitrova dd08314ed6 Uncomment prepared_statements_cache_size, key_cache_size, counter_cache_size, index_summary_capacity which were
commented out by mistake in a previous patch;
Fix breaking change with cache_load_timeout; cache_load_timeout_seconds <=0 and cache_load_timeout=0 are equivalent
and they both mean disabled;
Deprecate public method setRate(final double throughputMbPerSec) in Compaction Manager in favor of
setRateInBytes(final double throughputBytesPerSec);
Revert breaking change removal of StressCQLSSTableWriter.Builder.withBufferSizeInMB(int size). Deprecate it in favor
of StressCQLSSTableWriter.Builder.withBufferSizeInMiB(int size);
Fix precision issues, add new -m flag (for nodetool/setstreamthroughput, nodetool/setinterdcstreamthroughput,
nodetool/getstreamthroughput and nodetoo/getinterdcstreamthroughput), add new -d flags (nodetool/getstreamthroughput,
 nodetool/getinterdcstreamthroughput, nodetool/getcompactionthroughput);
Fix a bug with precision in nodetool/compactionstats;
Deprecate StorageService methods and add new ones for stream_throughput_outbound, inter_dc_stream_throughput_outbound,
compaction_throughput_outbound in the JMX MBean `org.apache.cassandra.db:type=StorageService`;
Removed getEntireSSTableStreamThroughputMebibytesPerSec in favor of new getEntireSSTableStreamThroughputMebibytesPerSecAsDouble
in the JMX MBean `org.apache.cassandra.db:type=StorageService`;
Removed getEntireSSTableInterDCStreamThroughputMebibytesPerSec in favor of getEntireSSTableInterDCStreamThroughputMebibytesPerSecAsDouble
in the JMX MBean `org.apache.cassandra.db:type=StorageService`

Patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, Francisco Guerrero for CASSANDRA-17225
2022-08-01 19:05:13 -04:00
Ekaterina Dimitrova b94bf3f218 Merge branch 'cassandra-4.1' into trunk 2022-07-29 13:35:55 -04:00
Ekaterina Dimitrova fe28f482db Fix sstable_preemptive_open_interval_in_mb disabled value - backward compatibility
patch by Ekaterina Dimitrova; reviewed by Andres de la Pena and Jon Meredith for CASSANDRA-17737
2022-07-29 13:26:31 -04:00
Ekaterina Dimitrova d2d6afb8e9 Merge branch 'cassandra-4.1' into trunk 2022-07-25 10:19:55 -04:00
Ekaterina Dimitrova 1c70149ef5 Fix Settings Virtual Table to update paxos_variant after startup and rename enable_uuid_sstable_identifiers to uuid_sstable_identifiers_enabled as per our config naming conventions
patch by Ekaterina Dimitrova; reviewed by Brandon Williams for CASSANDRA-17738
2022-07-25 10:08:09 -04:00
Josh McKenzie 91b86487fe Add guardrail to disallow DROP KEYSPACE commands for non superuser accounts
Patch by Josh McKenzie; reviewed by Aleksey Yeschenko for CASSANDRA-17767
2022-07-22 12:19:49 -04:00
Ekaterina Dimitrova 66177be587 Merge branch 'cassandra-4.1' into trunk 2022-07-22 09:48:15 -04:00
Ekaterina Dimitrova 9beeaf87bd Merge branch 'cassandra-4.0' into cassandra-4.1 2022-07-22 09:41:38 -04:00
Savni Nagarkar 39e89fd636 Add guardrail for maximum replication factor
Patch by Savni Nagarkar; reviewed by Andrés de la Peña, David Capwell and Josh McKenzie for CASSANDRA-17500
2022-06-23 15:53:33 +01:00
Yifan Cai 99d034a224 Option to disable CDC on SSTable repair
patch by Yifan Cai; reviewed by Josh McKenzie for CASSANDRA-17666
2022-06-07 11:30:49 -07:00
Josh McKenzie 14fbab15bd Add guardrail to allow disabling SimpleStrategy
Patch by Josh McKenzie; reviewed by Aleksey Yeschenko for CASSANDRA-17647
2022-05-26 15:06:58 -04:00
Jyothsna Konisa ed3901823a Adding support for TLS client authentication for internode communication
patch by Jyothsna Konisa; reviewed by Bernardo Botella, Francisco Guerrero, Jon Meredith, Maulin Vasavada, Yifan Cai for CASSANDRA-17513
2022-05-24 13:13:25 -07:00
Ekaterina Dimitrova c0b175595d Merge branch 'cassandra-4.1' into trunk 2022-05-20 14:36:46 -04:00
Ekaterina Dimitrova a67a2a2441 Handle config parameters upper bound on startup; Fix auto_snapshot_ttl and paxos_purge_grace_period min unit validations
patch by Ekaterina Dimitrova and Andres de la Pena; reviewed by Andres de la Pena and Caleb Rackliffe for CASSANDRA-17571

Co-authored-by: Ekaterina Dimitrova <ekaterina.dimitrova@datastax.com>
Co-authored-by: Andrés de la Peña <a.penya.garcia@gmail.com>
2022-05-20 14:27:20 -04:00
Josh McKenzie ce515a3d77 Add guardrail for ALTER TABLE ADD / DROP / REMOVE column operations
Patch by Josh McKenzie; reviewed by Jon Meredith for CASSANDRA-17495
2022-05-09 12:21:39 -04:00
Josh McKenzie 030831c5f5 Rename truncate_drop guardrail to drop_truncate_table
Patch by Josh McKenzie; reviewed by Andres de la Pena for CASSANDRA-17592
2022-05-06 11:48:45 -04:00
Paulo Motta 7741eacc54 Add auto_snapshot_ttl configuration
Patch by Paulo Motta; Reviewed by Stefan Miklosovic for CASSANDRA-16790

Co-authored-by: fibersel <0583463@gmail.com>
2022-04-30 17:28:17 -03:00
Stefan Miklosovic bd36cb9f6b implement startup check to prevent Cassandra to potentially spread zombie data
patch by Stefan Miklosovic; reviwed by Paulo Motta and Brandon Williams for CASSANDRA-17180
2022-04-29 13:22:51 +02:00