av9ash/GitBugs huggingface dataset:
Bug: Allow CommitLogSegmentReader to optionally skip sync marker CRC checks
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 10/Aug/21 21:13
Resolved: 25/Aug/21 20:30

CommitLog sync markers are written in two phases. In the first, zeroes are written for the position of the next sync marker and the sync marker CRC value. In the second, when the next sync marker is written, the actual position and CRC values are written. If the process shuts down in a disorderly fashion, it is entirely possible for a valid next marker position to be written to our memory mapped file but not the final CRC value. Later, when we attempt to replay the segment, we will fail without recovering any of the perfectly valid mutations it contains. (This assumes we’re confining ourselves to the case where there is no compression or encryption.)

{noformat}
ERROR 2020-11-18T10:55:23,888 [main] org.apache.cassandra.utils.JVMStabilityInspector:102 - Exiting due to error while processing commit log during initialization.
org.apache.cassandra.db.commitlog.CommitLogReplayer$CommitLogReplayException: Encountered bad header at position 23091775 of commit log …/CommitLog-6-1605699607608.log, with invalid CRC. The end of segment marker should be zero.
        at org.apache.cassandra.db.commitlog.CommitLogReplayer.handleReplayError(CommitLogReplayer.java:731)
        at org.apache.cassandra.db.commitlog.CommitLogReplayer.readSyncMarker(CommitLogReplayer.java:274)
        at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:436)
        at org.apache.cassandra.db.commitlog.CommitLogReplayer.recover(CommitLogReplayer.java:189)
        at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:170
        at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:151)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:332)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:656)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:808)
{noformat}

It may be useful to provide an option that would allow us to override the default/strict behavior here and skip the CRC check if a non-zero end position is present, allowing valid mutations to be recovered and startup to proceed.
Bug: Background schedule to clean up orphaned hints files
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 28/Jul/21 00:13
Resolved: 11/Aug/21 04:49

Host replacement is possible to produce orphaned hints files that the original associated host ID no longer exist in the cluster (i.e., being replaced). Those orphaned hints files will not be dispatched and only consumes up the disk space. 

We can have a background schedule that infrequently checks and deletes the files if they are orphaned and have exceeded the TTL.
Bug: Reduce native_transport_max_frame_size_in_mb
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 26/Aug/21 15:09
Resolved: 09/Sep/21 19:22

There is really no point in having this set to 256MB when the commitlog segment size defaults to 32MB, effectively capping the largest insertable mutation to 16MB.

The native transport can provide a good first line of defense against large mutations that would otherwise hit the heap if left to be rejected by the commitlog.
Bug: Scrub still uses "row" to mean "partitions", and has broken code
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 09/Aug/21 20:45
Resolved: 17/Aug/21 19:23

2 issues in the scrub code:
 1) It still uses "row" to mean "partition". And not only in the code, but also in user messages. As we've fairly systematically remove such instances elsewhere in 3.0+, having it in scrub is going to confuse users which will almost surely misinterpret the results. If scrub says that it dropped 2 unreadable "rows" from your sstable, you might be ok with that when we're actually talking about CQL rows, but not if we talk of 2 full partitions.
 2) There is a branch at the end of scrub that is supposed to handle the case where scrubbing a sstable generates no output at all (the sstable is completely hosed usually), mostly providing a more user friendly message. The code is broken (and has been for a long time, since CASSANDRA-7066 I believe) however such that this branch can simply never be taken (even when it should). While admittedly pretty minor, no reason to leave it that way.
Bug: Support atomic addition and append for LWTs
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 08/Sep/21 17:56
Resolved: 22/Nov/21 11:52

To support CEP-10 we require some atomic functionality that modifies the state of a register as part of the transaction. Specifically, we require at least the ability to append a string to another string. Since this is more widely useful, at the same time we also support addition on numeric fields so that users may maintain precise counters using Paxos, should they wish.
Bug: jvm-dtest-upgrade failing MixedModeReadTest.mixedModeReadColumnSubsetDigestCheck, ClassNotFoundException: com.vdurmont.semver4j.Semver
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 14/Jul/21 12:25
Resolved: 10/Sep/21 22:44

Caused by CASSANDRA-16649

Reproducible locally. Oddly enough can be reproduced on cassandra-4.0 branch as well, though CI is not failing.

fyi [~ifesdjeen]
Bug: Weak visibility guarantees of Accumulator lead to failed assertions during digest comparison
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 16/Jul/21 18:47
Resolved: 21/Jul/21 17:59

This problem could manifest on all versions, beginning on at least 3.0, but I’ll focus on the way it manifests in 4.0 here.

In what now seems like a wise move, CASSANDRA-16097 added an assertion to {{DigestResolver#responseMatch()}} that ensures the responses snapshot has at least one visible elements to compare (although of course only one element trivially cannot generate a mismatch and short-circuits immediately). However, at the point {{ReadCallback#onResponse()}} signals the waiting resolver, there is no guarantee that the size of the generated snapshot of the responses {{Accumulator}} is non-zero, or perhaps more worryingly, at least equal to the number of blocked-for responses. This seems to be a consequence of the documented weak visibility guarantees on {{Accumulator#add()}}. In short, if there are concurrent invocations of add(), is it not guaranteed that there is any visible size change after any one of them return, but only after all complete.

The particular exception looks something like this:

{noformat}
java.lang.AssertionError: Attempted response match comparison while no responses have been received.
	at org.apache.cassandra.service.reads.DigestResolver.responsesMatch(DigestResolver.java:110)
	at org.apache.cassandra.service.reads.AbstractReadExecutor.awaitResponses(AbstractReadExecutor.java:393)
	at org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:2150)
	at org.apache.cassandra.service.StorageProxy.readRegular(StorageProxy.java:1979)
	at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:1882)
	at org.apache.cassandra.db.SinglePartitionReadCommand$Group.execute(SinglePartitionReadCommand.java:1121)
	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:296)
	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:248)
	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:90)
{noformat}

It’s possible to reproduce this on simple single-partition reads without any short-read protection or replica filtering protection. I’ve also been able to reproduce this synthetically with [a unit test|https://github.com/apache/cassandra/pull/1110] on {{ReadCallback}}.

It seems like the most straightforward way to fix this would be to avoid signaling in {{ReadCallback#onResponse()}} until the visible size of the accumulator is at least the number of received responses. In most cases, this is trivially true, and our signaling behavior won’t change at all. In the very rare case that there are two (or more) concurrent calls to {{onResponse()}}, the second (or last) will signal, and having one more response than we strictly need should have no negative side effects. (We don’t seem to make any strict assertions about having exactly the number of required responses, only that we have enough.)
Bug: CQLTester open more java driver connections than required by the tests
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 06/Sep/21 11:34
Resolved: 07/Sep/21 13:38

When {{requireNetwork}} or {{reinitializeNetwork}} is called within a {{CQLTester}} unit test the test will open 4 connections to the server (one for each protocol version) even if the test only require a single connection.

There are no good reasons for that behavior and the connections can simply be opened on a lazy way.
Bug: ArrayIndexOutOfBoundsException in FunctionResource#fromName
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 20/Sep/21 08:12
Resolved: 24/Sep/21 06:40

{{FunctionResource}} can't handle functions with 0 args where it throws:

{noformat}
2021-04-08 10:45:40,984 ErrorMessage.java:387 - Unexpected exception during request
java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.cassandra.auth.FunctionResource.fromName(FunctionResource.java:178)
{noformat}
Bug: Prewarm role and credentials caches to avoid timeouts at startup
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 15/Sep/21 14:14
Resolved: 13/Jan/22 20:48

With our current auth querying setup, you can end up with a thundering herd on reconnect due to delays on auth resolution.

We should instead allow the ability to do a 'select' on all roles and pre-load the cache before turning on native transport. Notably, this could present some unacceptable delays on start with a very large count of users (thousands), or someone who uses a third party auth system rather than the built-in authorizer so this should be configurable and opt-in.
Bug: Add node tool commands to recompress sstables and upgrade all sstables created before given timestamp 
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 10/Aug/21 09:45
Resolved: 06/Sep/21 11:17

When changing compression parameters and testing their results, it is useful to be able to recompress only sstables that need to be recompressed. 

Similarly, it is often useful to be able to skip sstables that were flushed with expected parameters (i.e., created after some point in time), and only pick up sstables that are older than the given timestamp.
Bug: Fix org.apache.cassandra.distributed.test.OptimiseStreamsRepairTest.randomTest
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 17/Sep/21 21:44
Resolved: 23/Sep/21 09:44

org.apache.cassandra.distributed.test.OptimiseStreamsRepairTest.randomTest is [failing|https://jenkins-cm4.apache.org/job/Cassandra-devbranch/1120/testReport/junit/org.apache.cassandra.distributed.test/OptimiseStreamsRepairTest/randomTest/] on 4.0  
h3.  
{code:java}
Error Message
nodetool command [repair, distributed_test_keyspace, -vd] was not successful stdout: [2021-09-15 16:45:34,539] Starting repair command #2 (58d1e2a0-1644-11ec-8c42-ef15a225544a), repairing keyspace distributed_test_keyspace with repair options (parallelism: parallel, primary range: false, incremental: true, job threads: 1, ColumnFamilies: [], dataCenters: [], hosts: [], previewKind: REPAIRED, # of ranges: 3, pull repair: false, force repair: false, optimise streams: false, ignore unreplicated keyspaces: false) [2021-09-15 16:45:34,552] Repair command #2 failed with error Repair session 58d2cd00-1644-11ec-8c42-ef15a225544a for range [(-3074457345618258603,3074457345618258601], (9223372036854775805,-3074457345618258603], (3074457345618258601,9223372036854775805]] failed with error An incremental repair with session id 560ecb00-1644-11ec-8c42-ef15a225544a finished during this preview repair runtime [2021-09-15 16:45:34,552] Repair command #2 finished with error
{code}
Bug: Mockable FileSystem
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 08/Sep/21 17:49
Resolved: 07/Oct/21 11:29

To support CEP-10 it is necessary to support alternative file system implementations so that execution may be consistent between hosts. This ticket introduces a new File API backed by Path objects, and all File usages are ported to it. This necessitates the migration away from RandomAccessReader, but otherwise the change is mostly straight-forward, if quite expansive.
Bug: ArrayClustering.unsharedHeapSize does not include the data so undercounts the heap size
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 11/Aug/21 18:21
Resolved: 11/Aug/21 20:26

We have two methods: unsharedHeapSize and unsharedHeapSizeExcludingData; for ArrayClustering they are basically the same as unsharedHeapSize does not include the data, which is a regression.
Bug: Add required -f / --force option to nodetool verify
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 30/Sep/21 16:13
Resolved: 24/Mar/22 16:01

nodetool verify has some pretty significant problems with it (see CASSANDRA-9947).

Until such time as we do the heavy(er) lift to fix the command, we should make it harder for people to shoot themselves in the foot with it. Adding a required "-f" flag to it with a requisite "Do you really know what you're doing? Check out this JIRA first" seems like it'd be the right thing to do in the interim.
Bug: Optionally prune CDC segments if consumer fails to consume them fast enough
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 27/Sep/21 17:11
Resolved: 06/Dec/21 05:18

Current CDC implementation blocks writes if the CDC segments have filled up. This makes sense for some use-cases. In other cases it would be beneficial for C* to prune the CDC segments if they haven't been consumed. This will prevent blocking of writes. With this change we will introduce a flag to prune CDC segments much like a circular buffer. This will prevent the writes being blocked.
Bug: Use paxos_variant to specify Paxos behaviour
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 08/Sep/21 17:55
Resolved: 22/Nov/21 11:54

This patch introduces a config property for specifying the desired Paxos implementation and semantics. Initially, this will support only v1_norrl and v2, with “norrl” meaning “no read/read linearizability” i.e. supporting those use cases that need to restore prior performance, but only for read/read interactions.
Bug: Improvements to @Shared annotation
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 08/Sep/21 17:53
Resolved: 07/Oct/21 15:32

To support CEP-10 it is necessary to expand our functionality for selectively sharing classes between class loaders. This ticket introduces functionality to specify various recursive scopes of sharing, so that you may specify that any transitive dependencies of the class or interface may be also shared. That is, you may specify that those types necessary to implement or invoke methods on the class or interface must also be shared, that inner classes and types may also be shared, and that parent classes (and their inner classes and API dependencies) may also be shared.

Additionally, validation has been added to ensure that the specified sharing level encompasses the transitive closure of classes that will need to be loaded to use a class.
Bug: Fix flaky test - TokenMetadataTest.testRingIteratorIncludeMin
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 28/Sep/21 12:42
Resolved: 28/Sep/21 20:17

As Berenguer noted on CASSANDRA-15290.

https://ci-cassandra.apache.org/job/Cassandra-trunk/733/testReport/junit/org.apache.cassandra.locator/TokenMetadataTest/testRingIteratorIncludeMin_2/
Bug: WEBSITE - September 2021 blog post on Reaper
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 16/Sep/21 20:32
Resolved: 16/Oct/21 13:01

This ticket is to capture the work associated with publishing the August 2021 blog post. In the blog post we will cover the topic of Reaper and repairs.

We can close this once the blog post has gone live on the website.
Bug: Prevent broken concurrent schema pulls
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 16/Aug/21 05:27
Resolved: 19/Aug/21 05:45

There's a race condition around pulling schema changes, that can occur in case the schema changes push/propagation mechanism is not immediately effective (e.g. because of network delay, or because of the pulling node being down, etc.).

If schema changes happen on node 1, these changes do not reach node 2 immediately through the SCHEMA.PUSH mechanism, and are first recognized during gossiping, the corresponding SCHEMA.PULL request from node 2 can catch the node 1 schema in the middle of it being modified by another schema change request. This can easily lead to problems (e.g. if a new table is being added, and the node 2 request reads the changes that need to be applied to  system_schema.tables, but not the ones that need to be applied to system_schema.columns).

This PR addresses that by synchronizing the SCHEMA.PULL "RPC call" executed in node 1 by a request from node 2 with the method for applying schema changes in node 1.
Bug: WEBSITE - Update supported versions, mark 2.2 as EOL
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 27/Aug/21 08:21
Resolved: 04/Sep/21 08:36

The [Download|https://cassandra.apache.org/_/download.html] page incorrectly lists Cassandra 2.2 as:
{quote}Apache Cassandra 2.2
 Released on 2020-11-04, and supported until 4.1 release (April 2022) with critical fixes only
{quote}
At this point, only Cassandra 3.0 is supported until the 4.1 release.

 

!CASSANDRA-16891-download-page.png|width=300!
Bug: InetAddressAndPort to extend InetAddress
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 08/Sep/21 17:50
Resolved: 07/Oct/21 11:30

Logically InetAddressAndPort encapsulates the same information as a simple InetAddress. Importantly, InetAddressAndPort cannot easily be unpicked from its dependencies that prohibit it being shared between classloaders. So our in-jvm dtest API instead uses SocketAddress. To support a clean and efficient Streaming API we need to be able to treat InetAddressAndPort as such a cross-classloader type.
Bug: Fix upgrade dtests (after cassandra-4.0 branch bumped to 4.0.1)
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 01/Jul/21 11:57
Resolved: 04/Jul/21 10:55

{noformat}
Regression
dtest-upgrade.upgrade_tests.paging_test.TestPagingDataNodes2RF1_Upgrade_current_4_0_x_To_indev_4_0_x.test_static_columns_paging (from Cassandra dtests)

Failing for the past 1 build (Since Unstable#116 )
Took 46 sec.
 Failed 1 times in the last 29 runs. Flakiness: 3%, Stability: 96%
Error Message
TypeError: '<' not supported between instances of 'str' and 'int'
Stacktrace
self = <abc.TestPagingDataNodes2RF1_Upgrade_current_4_0_x_To_indev_4_0_x object at 0x7f5ff1817c10>

    @since('2.0.6')
    def test_static_columns_paging(self):
        """
            Exercises paging with static columns to detect bugs
            @jira_ticket CASSANDRA-8502.
            """
        cursor = self.prepare(row_factory=named_tuple_factory)
        cursor.execute("CREATE TABLE test (a int, b int, c int, s1 int static, s2 int static, PRIMARY KEY (a, b))")
    
        for is_upgraded, cursor in self.do_upgrade(cursor, row_factory=named_tuple_factory):
>           min_version = min(self.get_node_versions())

upgrade_tests/paging_test.py:661: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.8/distutils/version.py:52: in __lt__
    c = self._cmp(other)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = LooseVersion ('4.0-rc1'), other = LooseVersion ('4.0.1')

    def _cmp (self, other):
        if isinstance(other, str):
            other = LooseVersion(other)
    
        if self.version == other.version:
            return 0
>       if self.version < other.version:
E       TypeError: '<' not supported between instances of 'str' and 'int'

/usr/lib/python3.8/distutils/version.py:337: TypeError
{noformat}
from https://ci-cassandra.apache.org/job/Cassandra-4.0/116/testReport/junit/dtest-upgrade.upgrade_tests.paging_test/TestPagingDataNodes2RF1_Upgrade_current_4_0_x_To_indev_4_0_x/test_static_columns_paging/ 

ref: https://the-asf.slack.com/archives/CK23JSY2K/p1625125464283300
Bug: WEBSITE - Remove Docker reference in the Debian section of /download.html
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 15/Sep/21 07:26
Resolved: 16/Oct/21 09:24

Remove this line from the Debian section of the [Download|https://cassandra.apache.org/_/download.html] page:

{quote}You’ll need to have Docker Desktop for Mac, Docker Desktop for Windows, or similar software installed on your computer.{quote}

[PR #71|https://github.com/apache/cassandra-website/pull/71] submitted by [~elsmorian].
Bug: Flaky tests due to teardown failure
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 14/Sep/21 10:25
Resolved: 20/Oct/21 16:05

Different dtests in several CircleCI builds failed with teardown failure due to network failure with the error:
{code}
test teardown failure
Unexpected error found in node logs (see stdout for full details). Errors: [WARN  [epollEventLoopGroup-5-4] 2021-09-14 09:35:15,897 ExceptionHandlers.java:134 - Unknown exception in client networking
io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer, WARN  [epollEventLoopGroup-5-4] 2021-09-14 09:35:15,897 ExceptionHandlers.java:134 - Unknown exception in client networking
io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer]
{code}

For example, {{test_view_metadata_cleanup}} from {{materialized_views_test.TestMaterializedViews}} failed in [this build|https://app.circleci.com/pipelines/github/k-rus/cassandra/18/workflows/0cb193f3-ffe8-41c1-a376-43c91634579e/jobs/185/tests#failed-test-0] or {{test_expiration_overflow_policy_reject}} from {{ttl_test.TestTTL}} failed in [this build|https://app.circleci.com/pipelines/github/k-rus/cassandra/8/workflows/da99468d-c513-4a4f-9fd3-48b67482ce3e/jobs/67/tests#failed-test-0]
Bug: org.apache.cassandra.db.rows.ArrayCell#unsharedHeapSizeExcludingData includes data twice
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 30/Aug/21 17:14
Resolved: 31/Aug/21 15:40

org.apache.cassandra.db.rows.ArrayCell#unsharedHeapSizeExcludingData includes data and adds the length; so includes data twice