av9ash/GitBugs huggingface dataset:
Bug: build artifact download failed due to http
Status: Resolved
Priority: Normal
Resolution: Invalid
Created: 23/Jan/20 05:59
Resolved: 23/Jan/20 10:27

Please feel free to close if not apt. 

The build for cassandra 3.11.4 is failing due to `http` usage in build,properties.default and build.xml. 

Maven2 Repository Locations (you can override these in "build.properties" to point to a local proxy, e.g. Nexus)
artifact.remoteRepository.central:        http://repo1.maven.org/maven2
artifact.remoteRepository.apache:       http://repo.maven.apache.org/maven2

Changing it to `https` resolves the issue. Also seen that 3.11.5 tag has https. 
Can this be backported  to 3.11.4 ?
Bug: Failed partition updates should not consume memtable space
Status: Triage Needed
Priority: Normal
Created: 22/Jan/20 10:38

Moving my proposed patch for CASSANDRA-15367 here.  Contended memtable updates currently waste memtable memory each time they fail to apply.  This patch avoids this problem by ensuring we only copy data once onto the memtable, and reconcile this new data for all future attempts to insert.
Bug: Separate cqlsh into it's own git repo
Status: Resolved
Priority: Normal
Resolution: Information Provided
Created: 09/Jan/20 19:59
Resolved: 18/Jan/20 01:48

While looking into the CASSANDRA-10190, and seeing the long time there was no new version on pypi

[https://pypi.org/project/cqlsh/#history]

 

I thouhgt maybe it's time to separate cqlsh into it's own git repo, and handle more frequent release of it.

while have it installable regardless to Cassandra installation
Bug: INT is incompatible with previous type SMALLINT
Status: Triage Needed
Priority: Normal
Created: 14/Jan/20 23:35

With the release of Cassandra 3.11.5 and the fixing of CASSANDRA-14948, it now appears that you can no longer re-add a SMALLINT column as an INT type.  This is rather surprising as any SMALLINT value should be representable by an INT type.

The following example was run on Cassandra 3.11.5 on CentOS 7 installed from official RedHat repo:

 

 
{noformat}
cqlsh> CREATE KEYSPACE demo WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
cqlsh> CREATE TABLE demo.demo_table (
   ...   user_id BIGINT,
   ...   created TIMESTAMP,
   ...   points  SMALLINT,
   ...   PRIMARY KEY (user_id, created)
   ... ) WITH CLUSTERING ORDER BY (created DESC);
cqlsh> ALTER TABLE demo.demo_table DROP points;
cqlsh> ALTER TABLE demo.demo_table ADD  points INT;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot re-add previously dropped column 'points' of type int, incompatible with previous type smallint"{noformat}
Bug: Reduce LongBTreeTest iteration count
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 07/Jan/20 05:36
Resolved: 08/Jan/20 07:30

LongBTreeTest 2.2, 3.0, and 3.11 still takes 8+ hours to run because of the large iteration counts in it.

In trunk this has already fixed via CASSANDRA-9989

The iteration count should be reduced to something that is reasonable for both ASF Jenkins and CircleCI (ie less than an hour). For longer burns one can just go in at edit the iteration count value.
Bug: Change name of table metrics virtual table percentile columns
Status: Resolved
Priority: Low
Resolution: Fixed
Created: 14/Feb/20 22:32
Resolved: 26/Feb/20 03:33

The column names {{50th}} and {{90th}} are difficult to query as a selector or in aggregation functions since our parser expects a letter for initial char. It currently requires quoting like:
{code:sql}
SELECT table_name, "50th_ms", "99th_ms" FROM system_views.local_read_latency
{code}
Which is kinda difficult and non obvious, the error we give when not quoted also isnt that helpful. Since it is percentile a simple thing is to just ad a p infront:

{code:sql}
SELECT table_name, p50th_ms, p99th_ms FROM system_views.local_read_latency
{code}
Bug: Extract Javadoc into a separate package
Status: Resolved
Priority: Low
Resolution: Fixed
Created: 09/Feb/20 10:26
Resolved: 09/Apr/21 15:33

Right now, the {{javadoc}} directory occupies 99Mb out of the 149Mb of Cassandra 4.0-alpha3 installation. It would be useful to extract Javadocs into a separate package for package installations (RPM/DEB), and maybe create a separate artifact for tarball (or include them into {{src}}?)
Bug: Refactor protocol related code to eliminate magic numbers
Status: Open
Priority: Low
Created: 11/Mar/20 17:29

Parts of Cassandra's codebase has protocol related magic numbers. It makes the code hard to understand. We should refactor the code to remove magic numbers and instead replace them with versioned constants. This will help make the code clearer. Example: https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/transport/messages/ErrorMessage.java#L288
Bug: Add missing jenkins executor requirements to CI documentation
Status: Resolved
Priority: Low
Resolution: Fixed
Created: 03/Jan/20 20:30
Resolved: 06/Jan/20 08:30

The following provides information on how to set up Jenkins CI to test Cassandra the same as the ASF Jenkins does: http://cassandra.apache.org/doc/latest/development/ci.html 

The setup is remarkably easy, thanks [~spod].

The only hurdle I hit was the JDK and virtualenv needs to be installed on the executors.
Bug: Inconsistent failure messages on distributed queries
Status: Open
Priority: Low
Created: 13/Mar/20 18:37

As a follow up to some exploration I have done for CASSANDRA-15543, I realized the following behavior in both {{ReadCallback}} and {{AbstractWriteHandler}}:
 - await for responses
 - when all required number of responses have come back: unblock the wait
 - when a single failure happens: unblock the wait
 - when unblocked, look to see if the counter of failures is > 1 and if so return an error message based on the {{failures}} map that's been filled

Error messages that can result from this behavior can be a ReadTimeout, a ReadFailure, a WriteTimeout or a WriteFailure.

In case of a Write/ReadFailure, the user will get back an error looking like the following:

"Failure: Received X responses, and Y failures"

(if this behavior I describe is incorrect, please correct me)

This causes a usability problem. Since the handler will fail and throw an exception as soon as 1 failure happens, the error message that is returned to the user may not be accurate.

(note: I am not entirely sure of the behavior in case of timeouts for now)

For example, say a request at CL = QUORUM = 3, a failed request may complete first, then a successful one completes, and another fails. If the exception is thrown fast enough, the error message could say 
 "Failure: Received 0 response, and 1 failure at CL = 3"

Which:
1. doesn't make a lot of sense because the CL doesn't match the number of results in the message, so you end up thinking "what happened with the rest of the required CL?"
2. the information is incorrect. We did receive a successful response, only it came after the initial failure.

From that logic, I think it is safe to assume that the information returned in the error message cannot be trusted in case of a failure. Only information users should extract out of it is that at least 1 node has failed.

For a big improvement in usability, the {{ReadCallback}} and {{AbstractWriteResponseHandler}} could instead wait for all responses to come back before unblocking the wait, or let it timeout. This is way, the users will be able to have some trust around the information returned to them.

Additionally, an error that happens first prevents a timeout to happen because it fails immediately, and so potentially it hides problems with other replicas. If we were to wait for all responses, we might get a timeout, in that case we'd also be able to tell wether failures have happened *before* that timeout, and have a more complete diagnostic where you can't detect both errors at the same time.
Bug: Test Failures: org.apache.cassandra.metrics and a few others failing (utests_system_keyspace_directory on circleci)
Status: Resolved
Priority: Urgent
Resolution: Fixed
Created: 25/Mar/22 19:39
Resolved: 12/Jul/22 12:18

There are 10 tests failing in CircleCI - utests_system_keyspace_directory
This test target is not presented in Jenkins.
 
The tests fail for the same reason:


{code:java}
java.lang.RuntimeException: java.nio.file.NoSuchFileException: build/test/cassandra/data/system/_paxos_repair_state/ballot.meta.tmp at org.apache.cassandra.io.util.SequentialWriter.openChannel(SequentialWriter.java:128) at org.apache.cassandra.io.util.SequentialWriter.<init>(SequentialWriter.java:161) at org.apache.cassandra.io.util.SequentialWriter.<init>(SequentialWriter.java:150) at org.apache.cassandra.service.paxos.uncommitted.PaxosBallotTracker.flush(PaxosBallotTracker.java:130) at org.apache.cassandra.service.paxos.uncommitted.PaxosStateTracker.maybeRebuild(PaxosStateTracker.java:309) at org.apache.cassandra.service.paxos.PaxosState.maybeRebuildUncommittedState(PaxosState.java:122) at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:368) at org.apache.cassandra.service.CassandraDaemon.init(CassandraDaemon.java:655) at org.apache.cassandra.service.EmbeddedCassandraService.start(EmbeddedCassandraService.java:50) at org.apache.cassandra.metrics.CQLMetricsTest.setup(CQLMetricsTest.java:53) Caused by: java.nio.file.NoSuchFileException: build/test/cassandra/data/system/_paxos_repair_state/ballot.meta.tmp at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177) at java.nio.channels.FileChannel.open(FileChannel.java:287) at java.nio.channels.FileChannel.open(FileChannel.java:335) at org.apache.cassandra.io.util.SequentialWriter.openChannel(SequentialWriter.java:113){code}
The tests started failing every time after CEP 14 was committed.

For reference:
 * build before - https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/1484/workflows/88cac38a-ee0c-46e2-a6a7-5c364ff04f3e/jobs/9680
 * build after - [https://app.circleci.com/pipelines/github/ekaterinadimitrova2/cassandra/1485/workflows/c3f56ec1-2ef0-4e61-b689-c7764934827d/jobs/9682]

I think the only unrelated is 
{code:java}
testTokenGenerator_single_rack_or_single_rf{code}
Bug: Pip doesn't install ccm every time
Status: Resolved
Priority: Urgent
Resolution: Fixed
Created: 06/Feb/22 22:20
Resolved: 11/Mar/22 12:17

In CASSANDRA-16688 we fixed requirements.txt in DTest repo, pip install to run without -e for ccm in order to address the moveable tag. That worked for some time until last night. I successfully retagged and now ccm is not re-installed in Circle CI.

Jenkins picked stuff though. But it was acting unreliably and weird so rerunning now things there. Results pending.

Now I added -e for ccm in requirements.txt and it worked in CircleCI. Still pending results. I don't think this will be permanent solution and I am not sure whether it will affect also the previous branches in a way. We need to further investigate it and test. 

For now I will ask people to test with -e until we figure it out.

CC [~mck] , [~bereng] , [~dcapwell]  and [~stefan.miklosovic]
Bug: WEBSITE - February 2022 blog "Upgrade Advisory: 3.0, 3.11, 4.0 Possible for Remote Code Execution for Scripted UDFs"
Status: Resolved
Priority: Urgent
Resolution: Fixed
Created: 18/Feb/22 18:43
Resolved: 21/Mar/22 10:21

This ticket is to capture the work associated with publishing the February 2022 blog "Upgrade Advisory: 3.0, 3.11, 4.0 Possible for Remote Code Execution for Scripted UDFs"

If this blog cannot be published by the *February 18, 2022 publish date*, please contact me/suggest changes when possible in the pull request for the appropriate time that the blog will go live (on blog.adoc and in the blog post .adoc).
Bug: Test failure: dtest-offheap.counter_test.TestCounters.test_13691
Status: Resolved
Priority: Urgent
Resolution: Fixed
Created: 15/Feb/22 20:46
Resolved: 16/Feb/22 12:28

This test fails only off heap on 3.11, hard to say when it started as it was always failing since we have Butler. Marking it critical as it shows breaking config change.
h3. Stacktrace

Unexpected error found in node logs (see stdout for full details). Errors: [ERROR [main] 2022-02-10 05:06:27,462 DatabaseDescriptor.java (line 117) Fatal configuration error org.apache.cassandra.exceptions.ConfigurationException: Invalid yaml. Please remove properties [memtable_allocation_type] from your cassandra.yaml at org.apache.cassandra.config.YamlConfigurationLoader$MissingPropertiesChecker.check(YamlConfigurationLoader.java:137) at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100) at
Bug: Bump java-driver dependency in Cassandra to latest 3.x series 
Status: Resolved
Priority: High
Resolution: Won't Fix
Created: 07/Feb/22 17:36
Resolved: 08/May/24 08:18

We depend on java-driver for testing, and developing/validating native protocol changes. Unfortunately, the version of drvier that is  included with Cassandra is quite ancient: 3.0.1. We need to bump this dependency to latest in 3.x series, without upgrading to 4.0 at least for now. Unfortunately, this is not a trivial change in build.xml (otherwise I would’ve done it rather than opening this ticket), and bumping version breaks a few tests in all versions, so those need to be fixed, too. 

This should be a prerequiste for the next minor version release, too.
Bug: Request to port the DSE rebuild options to Cassandra
Status: Resolved
Priority: High
Resolution: Duplicate
Created: 30/Mar/22 17:20
Resolved: 27/Apr/22 13:17

Testing rebuild in C* 4.0.1, I ran into a scenario where 'nodetool rebuild' was ran without any options in a new DC and the system.available_ranges_v2 table was populated such that every subsequent run of 'nodetool rebuild <sourceDC>' streamed no data.

The problem was that the first run looked at only the new DC so no data was streamed, then the next run that provided the correct source DC still resulted in no streamed data.

Once the system.available_ranges_v2 table was truncated, rebuild worked as expected.

The request here is to include the same code that allows the following options to be used in DSE so one could easily resolve this by using '-m reset' in a similar scenario:

-m, --mode mode
 * normal - conventional behavior, streams only ranges that are not already locally available
 * refetch - resets locally available ranges, streams all ranges but leaves current data untouched
 * reset - resets the locally available ranges, removes all locally present data (like a TRUNCATE), streams all ranges
 * reset-no-snapshot - (like reset) resets the locally available ranges, removes all locally present data (like a TRUNCATE), streams all ranges but prevents a snapshot even if auto_snapshot is enabled

Protecting against updating the available_ranges table if a local DC was chosen might also be a good idea.
Bug: Fix Prepared Statements behaviours after 15252
Status: In Progress
Priority: Normal
Created: 10/Jan/22 14:53

[CASSANDRA-15252] has fixed an important issue: unwanted hash changes when preparing fully qualified prepared statements which was causing cluster-killing re-prepare loops. However, the fix introduced a regression: non-qualified statements can get prepared against one keyspace but then executed on another under some circumstances. This patch reconciles all behaviours.
Bug: Library airlift/airline has been deprecated
Status: Changes Suggested
Priority: Normal
Created: 16/Mar/22 11:34

The [airlift/airline|https://github.com/airlift/airline] library has been deprecated and is not maintained since [8 Jun 2021|https://github.com/airlift/airline/commit/ae3d7e103bdc140969bde944d4ba09345d663a61]. It is used in many tools and some tests of Cassandra which should be reviewed.

Tools using that library:
 * org.apache.cassandra.fqltool.FullQueryLogTool
 * org.apache.cassandra.hints.HintsMaker
 * org.apache.cassandra.simulator.SimulationRunner
 * org.apache.cassandra.simulator.paxos.PaxosSimulationRunner
 * org.apache.cassandra.simulator.test.HarrySimulatorTest
 * org.apache.cassandra.stress.Compaction
 * org.apache.cassandra.tools.JMXTool
 * org.apache.cassandra.tools.NodeTool

Alternatives (as suggested in the depreciation notice):
 * [Airline 2|https://rvesse.github.io/airline/]
 * [picocli|https://picocli.info/]
Bug: Test Failure: dtest-offheap.topology_test.TestTopology.test_decommissioned_node_cant_rejoin
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 26/Jan/22 17:55
Resolved: 26/May/23 11:42

https://ci-cassandra.apache.org/job/Cassandra-4.0/317/testReport/dtest-offheap.topology_test/TestTopology/test_decommissioned_node_cant_rejoin/

Failed 1 times in the last 20 runs. Flakiness: 5%, Stability: 95%

Error Message
AssertionError: assert None  +  where None = <function search at 0x7f0de9492c10>('This node was decommissioned and will not rejoin the ring', '', re.MULTILINE)  +    where <function search at 0x7f0de9492c10> = re.search  +    and   '' = <built-in method join of str object at 0x7f0de963b4b0>([])  +      where <built-in method join of str object at 0x7f0de963b4b0> = '\n'.join  +    and   re.MULTILINE = re.MULTILINE

{code}
Stacktrace
self = <topology_test.TestTopology object at 0x7f0de5899430>

    @since('3.0')
    def test_decommissioned_node_cant_rejoin(self):
        """
            @jira_ticket CASSANDRA-8801
    
            Test that a decommissioned node can't rejoin the cluster by:
    
            - creating a cluster,
            - decommissioning a node, and
            - asserting that the "decommissioned node won't rejoin" error is in the
            logs for that node and
            - asserting that the node is not running.
            """
        rejoin_err = 'This node was decommissioned and will not rejoin the ring'
        self.fixture_dtest_setup.ignore_log_patterns = list(self.fixture_dtest_setup.ignore_log_patterns) + [
            rejoin_err]
    
        self.cluster.populate(3).start()
        node1, node2, node3 = self.cluster.nodelist()
    
        logger.debug('decommissioning...')
        node3.decommission(force=self.cluster.version() >= '4.0')
        logger.debug('stopping...')
        node3.stop()
        logger.debug('attempting restart...')
        node3.start(wait_other_notice=False)
        try:
            # usually takes 3 seconds, so give it a generous 15
            node3.watch_log_for(rejoin_err, timeout=15)
        except TimeoutError:
            # TimeoutError is not very helpful to the reader of the test output;
            # let that pass and move on to string assertion below
            pass
    
>       assert re.search(rejoin_err,
                         '\n'.join(['\n'.join(err_list) for err_list in node3.grep_log_for_errors()]), re.MULTILINE)
E       AssertionError: assert None
E        +  where None = <function search at 0x7f0de9492c10>('This node was decommissioned and will not rejoin the ring', '', re.MULTILINE)
E        +    where <function search at 0x7f0de9492c10> = re.search
E        +    and   '' = <built-in method join of str object at 0x7f0de963b4b0>([])
E        +      where <built-in method join of str object at 0x7f0de963b4b0> = '\n'.join
E        +    and   re.MULTILINE = re.MULTILINE

topology_test.py:416: AssertionError
{code}
Bug: sstables changing in snapshots
Status: Resolved
Priority: Normal
Resolution: Not A Problem
Created: 23/Mar/22 00:55
Resolved: 06/Jan/25 15:31

We use cassandra snapshots and tar to make full backups of our cassandra clusters. Sometimes, tar fails with a message like

{{tar: data/addresses/addresses-eb0196100b7d11ec852b1541747d640a/snapshots/backup20220318183708/nb-167-big-Data.db: file changed as we read it}}

This is kind of strange, since we're reading from a snapshot.

The (very simplified) relevant snippet looks roughly like
{code:java}
nice nodetool "${JMX_ARGS[@]}" snapshot -t "$TAG" "${KEYSPACES[@]}"
tar --hard-dereference -czpf data///snapshots/"$TAG"/{code}
This happens maybe 1% of the time when taking backups.

There are no concurrent snapshots going on, but there are concurrent compactions and repairs, of course. If it matters, this cluster _is_ running incremental repairs.

This is on Cassandra 4.0.3.

It seems wrong to me that an sstable could ever be written to while it's in a snapshot.
Bug: DOC - Fix minor typos
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 31/Mar/22 13:48
Resolved: 02/Jan/25 08:29

There are minor typos in the following pages:
 * https://cassandra.apache.org/doc/latest/cassandra/cql/types.html => "the while collection":

 ** "the while collection"
 ** "by there position in the list"
 ** "one of these operation timeout"
 ** "An error will be thrown if the list does not have the position.:" (extra dot before the column)
 * [https://cassandra.apache.org/doc/latest/cassandra/cql/dml.html:]
 ** The `WHERE`clause is used to select (missing space before "clause")
 * [https://cassandra.apache.org/doc/latest/cassandra/getting_started/production.html:]
 ** "so additional throughout on reads"
Bug: Fix flaky test - dtest-large.snitch_test.TestDynamicEndpointSnitch.test_multidatacenter_local_quorum
Status: Open
Priority: Normal
Created: 02/Feb/22 13:34

Failed 6 times in the last 30 runs. Flakiness: 20%, Stability: 80%

AssertionError: too many reads hit the degraded node: 2 assert 2 <= 1
Bug: Flaky org.apache.cassandra.tools TopPartitionsTest testServiceTopPartitionsSingleTable
Status: Resolved
Priority: Normal
Resolution: Fixed
Created: 18/Mar/22 11:01
Resolved: 19/May/22 08:06

{code:java}
Error Messageexpected:<1> but was:<0>Stacktracejunit.framework.AssertionFailedError: expected:<1> but was:<0>
	at org.apache.cassandra.tools.TopPartitionsTest.testServiceTopPartitionsSingleTable(TopPartitionsTest.java:82)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Standard OutputINFO  [main] 2022-03-17 23:37:01,750 YamlConfigurationLoader.java:103 - Configuration location: file:/home/cassandra/cassandra/test/conf/cassandra.yaml
DEBUG [main] 2022-03-17 23:37:01,754 YamlConfigurationLoader.java:124 - Loading settings from file:/home/cassandra/cassandra/test/conf/cassandra.yaml
INFO  [main] 2022-03-17 23:37:01,878 Config.java:1119 - Node configuration:[allocate_tokens_for_keyspace=null; allocate_tokens_for_local_replication_factor=null; allow_extra_insecure_udfs=false; all
...[truncated 49100 chars]...
lizing counter cache with capacity of 2 MiBs
INFO  [MemtableFlushWriter:1] 2022-03-17 23:37:03,857 CacheService.java:164 - Scheduling counter cache save to every 7200 seconds (going to save all keys).
DEBUG [MemtableFlushWriter:1] 2022-03-17 23:37:03,883 ColumnFamilyStore.java:1249 - Flushed to [BigTableReader(path='/home/cassandra/cassandra/build/test/cassandra/data/system/IndexInfo-9f5c6374d48532299a0a5094af9ad1e3/nb-1-big-Data.db')] (1 sstables, 4.915KiB), biggest 4.915KiB, smallest 4.915KiB {code}