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
Also, fixes MigrationCoordinatorTest and adds version assertions to Instance.startup
Patch by Jacek Lewandowski; reviewed by Ekaterina Dimitrova for CASSANDRA-18902
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
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
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
The fix makes the DescribeStatement to wait for the in-progress schema transformations to finish before returning the first page. This way, the metadata and schema version encoded in the result set metadata are guaranteed to be consistent.
Patch by Jacek Lewandowski; reviewed by Benjamin Lerer, Ekaterina Dimitrova for CASSANDRA-18921
In this commit the `org.apache.cassandra.io.sstable.CQLSSTableWriter#build` method synchronizes on the
`Schema.instance` object (instead of the `CQLSSTableWriter.class`) to prevent concurrent schema operations
to fail when the offline tools also updates the schema.
For example, a table creation operation, which modifies the keyspace tables metadata, might end up
missing the update when a concurrent call to the `CQLSSTableWriter#build` method is accessing the
singleton Schema instance.
Patch by Francisco Guerrero, reviewed by Yifan Cai, Maxwell Guo, Alex Petrov for CASSANDRA-18317.
This patch also removes compress-lzf library (leftover from CASSANDRA-12229)
as well as it makes byte-buddy dependencies to be test scoped.
patch by Stefan Miklosovic; reviewed by Michael Semb Wever for CASSANDRA-18877
There are a couple of fixes in this patch. As explained on the ticket, some of the flaky failures are a race of two events that cause the termination of the connection. First is a legitimate close as a result of expected failures. In this case, the server sends the error message and closes the connection. The test expects to receive that message. However, the test was sending more messages that couldn't be received because the server already closed the connection, and they were bounced by the OS, causing immediate connection shutdown on the client side, even before it could receive the error message.
The fix is to stop sending the messages after sending the message, which is expected to cause a failure. Some other accompanying modifications include using Awaitility to wait for specific events and consider the configured maximum number of consecutive failures.
Also added some more logging to help investigate failures in the future.
Patch by Jacek Lewandowski; reviewed by Sam Tunnicliffe for CASSANDRA-16949
patch by Aleksey Yeschenko; reviewed by Blake Eggleston, Sam Tunnicliffe, and Caleb Rackliffe for CASSANDRA-16905
Co-authored by Aleksey Yeschenko (aleksey@apache.org)
Co-authored by Josh McKenzie (jmckenzie@apache.org)
This commit skips the initialization of `topPartitions` in `org.apache.cassandra.db.ColumnFamilyStore`
when running in client or tool mode. The `TopPartitionTracker` class will attempt to query the system
keyspace, which when running in client or tool mode will not be part of the KeyspaceMetadata. This
causes a warning to be printed out with a stacktrace that can be misleading. The warning is similar to
this:
```
WARN org.apache.cassandra.db.SystemKeyspace: Could not load stored top SIZES partitions for ...
org.apache.cassandra.db.KeyspaceNotDefinedException: keyspace system does not exist
at org.apache.cassandra.schema.Schema.validateTable(Schema.java:xxx) ~[?:?]
at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx) ~[?:?]
at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx) ~[?:?]
at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:xxx) ~[?:?]
at org.apache.cassandra.cql3.QueryProcessor.parseAndPrepare(QueryProcessor.java:xxx) ~[?:?]
...
```
In this commit, we check whether we run in client or tool mode, and skip initialization
of `topPartitions` in those cases.
Patch by Francisco Guerrero; Reviewed by Dinesh Joshi, Yifan Cai for CASSANDRA-18697
patch by Vincent White; reviewed by Stefan Miklosovic and Branimir Lambov for CASSANDRA-14204
Co-authored-by: Stefan Miklosovic <smiklosovic@apache.org>
patch by Chris Lohfink; reviewed by Caleb Rackliffe and Benedict Elliott Smith for CASSANDRA-15241
Co-authored-by: Chris Lohfink <clohfink@apple.com>
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Benedict Elliott Smith <benedict@apache.org>
patch by Stefan Miklosovic; reviewed by Jacek Lewandowski and Brandon Williams for CASSANDRA-16555
Co-authored-by: Jacek Lewandowski <lewandowski.jacek@gmail.com>
Co-authored-by: Paul Rütter <paul@blueconic.com>
patch by Stefan Podkowinski; reviewed by Robert Stupp for CASSANDRA-10508
backported in CASSANDRA-18575 by German Eichberger; reviewed by
brandonwilliams
Patch by Ningzi Zhan and Tomasz Lasica; reviewed by brandonwilliams,
edimitrova and Maxwell Guo for CASSANDRA-17818
Co-Authored-By: Tomek Lasica <tomasz.lasica@datastax.com>
If an sstable is corrupted in a nasty way, we may read invalid cell sizes and try to read much more data for a row than we should. In rare scenarios this can lead even to OOMs.
This simple fix adds tracking and limiting the amount of data that is read per row. Row has its size stored in preamble which can be used as a limit. If the deserialization code tries to read more than that, it will simply fail with EOF which will prevent more serious problems later.
Patch by Jacek Lewandowski; reviewed by Berenguer Blasi and Maxwell Guo for CASSANDRA-18513
# Conflicts:
# src/java/org/apache/cassandra/db/rows/UnfilteredSerializer.java
This patch also fixes the bug when creating GossipDigests in case epState in
Gossiper#makeRandomGossipDigest was null. Previously, if it was null, it used
generation and maxVersion of the last non-null epState instead of zeros.
patch by Cameron Zemek; reviewed by Stefan Miklosovic and Brandon Williams for CASSANDRA-18546
Adds separate WARN level messages to the check itself in Directories.
patch by Henrik Ingo; reviewed by Mick Semb Wever, Brad Schoening, Claude Warren, Kan Maung, maxwellguo for CASSANDRA-18260
This patch is a backport of CASSANDRA-17205 and also raises
logging level to 'error' from 'warn' in StrongLeakDetector.
Patch by jmckenzie; reviewed by smiklosovic for CASSANDRA-18332
patch by Caleb Rackliffe; reviewed by Jon Meredith for CASSANDRA-18370
Co-authored-by: Caleb Rackliffe <calebrackliffe@gmail.com>
Co-authored-by: Jon Meredith <jonmeredith@apache.org>
* cassandra-3.0:
Save host id to system.local and flush immediately after startup
Remove asf.yaml from non-trunk branches
Notify the corresponding JIRA issue as soon as the PR is raised
- Remove dead WriteCallbackInfo code
Patch by Paulo Motta, Aleksey Yeschenko; Reviewed by Stefan Miklosovic, Claude Warren for CASSANDRA-18304
Co-authored-by: Aleksey Yeschenko <aleksey@apache.org>
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
- Denormalize distributedAndLocalKeyspaces to remove perf degradation
- Set updated schema version once applied
patch by Jacek Lewandowski, reviewed by Stefan Miklosovic for CASSANDRA-18291
While testing the fix for trigger, we fixed the corresponding
trigger example. While on it, we detected that ssl-factory example was
not working either so it is fixed in this commit as well.
patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-18264
- Don't flush schema on every schema update in unit tests
- Use unix command to delete test data
- Shorten teardown
- Stable processor count presented by JMX on Jenkins, CircleCI and local
Patch by <jacek-lewandowski>, reviewed by <michaelsembwever> and <josh-mckenzie> for CASSANDRA-17427