Commit Graph

28453 Commits

Author SHA1 Message Date
Andrés de la Peña 3eb605b4db Remove deprecated CQL functions dateOf and unixTimestampOf
patch by Andrés de la Peña; reviewed by Berenguer Blasi and Stefan Miklosovic for CASSANDRA-18328
2023-03-16 15:43:45 +00:00
Stefan Miklosovic 58a3b12508
Remove DateTieredCompactionStrategy
patch by Stefan Miklosovic; reviewed by Jacek Lewandowski for CASSANDRA-18043
2023-03-16 09:38:10 +01:00
David Capwell 92c90cd4ef Merge branch 'cassandra-4.1' into trunk 2023-03-15 16:22:18 -07:00
David Capwell d5b1483703 Incompatible file system thrown while running Simulator
patch by David Capwell; reviewed by Brandon Williams, Caleb Rackliffe for CASSANDRA-18320
2023-03-15 16:19:04 -07:00
Stefan Miklosovic a76286795f
Add system_views.max_sstable_size and system_views.max_sstable_duration tables
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-18333
2023-03-15 21:18:40 +01:00
Stefan Miklosovic 4734dfc503
Extend implicit allow-filtering for virtual tables to clustering columns
patch by Stefan Miklosovic; reviewed by Aleksey Yeschenko for CASSANDRA-18331
2023-03-15 13:40:15 +01:00
Stefan Miklosovic 034e009e93
Merge branch 'cassandra-4.1' into trunk 2023-03-15 09:34:00 +01:00
Stefan Miklosovic 8d91b469af
Prepare debian changelog for 4.1.1 2023-03-15 09:09:07 +01:00
Abe Ratnofsky fb95112427 Upgrade maven-shade-plugin to 3.4.1 to fix shaded dtest JAR build
patch by Abe Ratnofsky; reviewed by Caleb Rackliffe CASSANDRA-18136
2023-03-14 15:57:14 -05:00
Brandon Williams 5c51f05dab Remove JAVA8/JAVA11_HOME from circle configs
Patch by brandonwilliams; reviewed by edimitrova and mck for
CASSANDRA-18106
2023-03-14 09:57:41 -05:00
Jacek Lewandowski d1ba381d96 Merge branch 'cassandra-4.1' into trunk
* cassandra-4.1:
  Fix the ordering of sstables when running sstableupgrade tool
2023-03-14 15:20:18 +01:00
Jacek Lewandowski deb8abd2fd Merge branch 'cassandra-4.0' into cassandra-4.1
* cassandra-4.0:
  Fix the ordering of sstables when running sstableupgrade tool
2023-03-14 15:18:37 +01:00
Jacek Lewandowski 5104008db9 Merge branch 'cassandra-3.11' into cassandra-4.0
* cassandra-3.11:
  Fix the ordering of sstables when running sstableupgrade tool
2023-03-14 15:16:22 +01:00
Jacek Lewandowski 58d06d34ab Merge branch 'cassandra-3.0' into cassandra-3.11
* cassandra-3.0:
  Fix the ordering of sstables when running sstableupgrade tool
2023-03-14 15:14:31 +01:00
Claude Warren 8df69c8016 Fix the ordering of sstables when running sstableupgrade tool
patch by Claude Warren; reviewed by Jacek Lewandowski and Stefan Miklosovic for CASSANDRA-18143
2023-03-14 14:52:53 +01:00
Brandon Williams 7ad746cc83 Revert "Switch checkstyle to j11."
This reverts commit 4e3447ae17.
2023-03-13 11:59:37 -05:00
Jacek Lewandowski 3eff9e755c Merge branch 'cassandra-4.1' into trunk 2023-03-13 09:59:18 +01:00
Jacek Lewandowski 8ba3888fcf Merge branch 'cassandra-4.0' into cassandra-4.1 2023-03-13 09:57:11 +01:00
Jaroslaw Grabowski 3cfb222122 Fix BufferPool.memoryInUse counter
The counter was incorrectly decremented by the size of the unused portion of the provided buffer.
It is now decremented by the number of bytes actually returned to the pool (that may be different than "size"). The number is calculated as a difference between original and resulting buffer capacity.

patch by Jaroslaw Grabowski <jtgrabowski>, reviewed by Jacek Lewandowski <jacek-lewandowski> for CASSANDRA-18311
2023-03-13 09:51:33 +01:00
Stefan Miklosovic 6eeb61d504
Merge branch 'cassandra-4.1' into trunk 2023-03-12 21:37:35 +01:00
Stefan Miklosovic b7eaa2d209
Deprecate org.apache.cassandra.hadoop code
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-16984
2023-03-12 21:34:29 +01:00
Brandon Williams 4e3447ae17 Switch checkstyle to j11.
Patch by brandonwilliams; reviewed by edimitrova for CASSANDRA-18262
2023-03-10 10:41:10 -06:00
Andrés de la Peña 6d62d2f4f2 Merge branch 'cassandra-4.1' into trunk 2023-03-10 11:53:47 +00:00
Andrés de la Peña bfc7621c8c Merge branch 'cassandra-4.0' into cassandra-4.1 2023-03-10 11:52:40 +00:00
Andrés de la Peña 2aedb58123 Merge branch 'cassandra-3.11' into cassandra-4.0 2023-03-10 11:51:25 +00:00
Andrés de la Peña 4b3cb0a772 Merge branch 'cassandra-3.0' into cassandra-3.11 2023-03-10 11:50:04 +00:00
Andrés de la Peña 02048cffea Remove -l / -m / -h designation and have two options: free or paid tier circle config
patch by Andrés de la Peña; reviewed by Ekaterina Dimitrova and Josh McKenzie for CASSANDRA-18012
2023-03-10 11:48:31 +00:00
Mick Semb Wever 91193e0fdf
Merge branch 'cassandra-4.1' into trunk
* cassandra-4.1:
  Restore 4.1's doc update for virtual table system_views.clients
2023-03-09 20:55:49 +01:00
Tibor Répási af82b941a8
Restore 4.1's doc update for virtual table system_views.clients
patch by Tibor Répási; reviewed by Ekaterina Dimitrova, Michael Semb Wever for CASSANDRA-18303, CASSANDRA-17344
2023-03-09 20:55:24 +01:00
Tibor Répási 414f4143e6
Restore 4.1's doc update for virtual table system_views.clients
patch by Tibor Répási; reviewed by Ekaterina Dimitrova, Michael Semb Wever for CASSANDRA-18303, CASSANDRA-17344
2023-03-09 20:47:59 +01:00
Brandon Williams bace51ce8e Merge branch 'cassandra-4.1' into trunk 2023-03-09 10:05:31 -06:00
Brandon Williams 0ea1d384d4 Merge branch 'cassandra-4.0' into cassandra-4.1 2023-03-09 10:04:31 -06:00
Brandon Williams a874e02eec Merge branch 'cassandra-3.11' into cassandra-4.0 2023-03-09 10:03:14 -06:00
Brandon Williams 326b5aceb1 Merge branch 'cassandra-3.0' into cassandra-3.11 2023-03-09 10:02:21 -06:00
Brandon Williams be574fc34b Fix default file system error handler for disk_failure_policy die
Patch by Runtian Liu; reviewed by brandonwilliams and smiklosovic for
CASSANDRA-18294
2023-03-09 10:00:49 -06:00
Mick Semb Wever f14fa978e4
Upgrade to Opcodes.ASM9
patch by Mick Semb Wever; reviewed by Ekaterina Dimitrova for CASSANDRA-17971
2023-03-09 10:21:39 +01:00
Jacek Lewandowski 065c671e65 Merge branch 'cassandra-4.1' into trunk 2023-03-09 08:16:27 +01:00
Jacek Lewandowski 5f7175d59d Small fixes around Schema management
- Denormalize distributedAndLocalKeyspaces to remove perf degradation
- Set updated schema version once applied

patch by Jacek Lewandowski, reviewed by Stefan Miklosovic for CASSANDRA-18291
2023-03-09 08:12:10 +01:00
Stefan Miklosovic 4841794028
Add MaxSSTableSize and MaxSSTableDuration metrics and propagate them together with local read/write ratio to tablestats
patch by Stefan Miklosovic; reviewed by Brandon Williams and Brad Schoening for CASSANDRA-18283
2023-03-08 16:29:19 +01:00
Stefan Miklosovic 180f0f0b5b
Add more logging around CompactionManager operations
patch by Stefan Miklosovic; reviewed by Brandon Williams, Brad Schoening and Kan Maung for CASSANDRA-18268

Co-authored-by: Milan Krisko <milan.krisko@gmail.com>
2023-03-07 21:31:18 +01:00
Jon Meredith 0bed1967fd Merge branch 'cassandra-4.1' into trunk 2023-03-07 10:48:48 -07:00
Jon Meredith 6adcff8f30 Merge branch 'cassandra-4.0' into cassandra-4.1 2023-03-07 10:36:16 -07:00
Benedict Elliott Smith 40f9ca60f1 Improve memtable allocator accounting when updating AtomicBTreePartition
patch by Benedict Elliott Smith; reviewed by Benjamin Lerer, Jon Meredith for CASSANDRA-18125
2023-03-07 10:28:32 -07:00
Mick Semb Wever 7ca806c60a
Change trunk from 4.2 to 5.0
– update MessagingService (remove the 4.1 version that was only a placeholder in test code bc serialisation test files were previously incorrectly serialising random UUIds for TimeUUIDs)
 – update upgrade jvm-dtests
 – remove older serialization binary files we are no longer testing against

 patch by Mick Semb Wever; reviewed by Brandon Williams for CASSANDRA-17973
2023-03-07 11:03:38 +01:00
Natnael Adere 35f8da66f9 Reduce memory allocations of calls to ByteBufer.duplicate() made in org.apache.cassandra.transport.CBUtil#writeValue
patch by Natnael Adere; reviewed by Benedict Elliott Smith, David Capwell for CASSANDRA-18212
2023-03-06 11:59:47 -08: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
Kamalesh Palanisamy 0a0e06847b org.apache.cassandra.db.compaction.CompactionStrategyManagerBoundaryReloadTest.testReload fails when running with TrieMemtables
patch by Kamalesh Palanisamy; reviewed by David Capwell, Jon Meredith for CASSANDRA-18144
2023-03-04 09:21:45 -07:00
David Capwell 4e17922b61 Gossip stateMapOrdering does not have correct ordering when both EndpointState are in the bootstrapping set
patch by David Capwell; reviewed by Marcus Eriksson for CASSANDRA-18292
2023-03-01 13:41:26 -08:00
Marcus Eriksson c747f70c05
Snapshot only sstables containing mismatching ranges on preview repair mismatch
patch by Marcus Eriksson, reviewed by Sam Tunnicliffe, Stefan Miklosovic for CASSANDRA-17561

Co-authored-by: Blake Eggleston <beggleston@apple.com>
2023-02-28 23:28:20 +01:00
Ekaterina Dimitrova d1e3c781b5 Add JDK17 startup scripts
patch by Ekaterina Dimitrova; reviewed by Mick Semb Wever for CASSANDRA-18258
2023-02-27 12:06:44 -05:00