You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "aratno (via GitHub)" <gi...@apache.org> on 2025/01/03 18:14:29 UTC
Re: [PR] CASSANDRA-20155: To improve accord interoperability test coverage, nehttps://github.com/dcapwell/cassandra/pull/new/CASSANDRA-20155 [cassandra]
aratno commented on code in PR #3753:
URL: https://github.com/apache/cassandra/pull/3753#discussion_r1901980343
##########
test/distributed/org/apache/cassandra/fuzz/topology/AccordTopologyMixupTest.java:
##########
Review Comment:
I think it's a known error, but test is failing for me locally with:
```
accord.utils.Property$PropertyError: Property error detected:
Seed = 3447854785953799011
Examples = 1
Pure = true
Error: org.apache.cassandra.exceptions.InvalidRequestException: DELETE statements must restrict all PRIMARY KEY columns with equality relations in order to delete non static columns
Steps: 20
Values:
State: Yaml Config:
---
commitlog_sync: group
commitlog_sync_group_window: 7ms
commitlog_disk_access_mode: legacy
memtable_allocation_type: unslabbed_heap_buffers
memtable:
configurations:
TrieMemtable:
class_name: TrieMemtable
ShardedSkipListMemtable:
class_name: ShardedSkipListMemtable
parameters:
serialize_writes: true
default:
inherits: ShardedSkipListMemtable
SkipListMemtable:
class_name: SkipListMemtable
sstable:
selected_format: bti
disk_access_mode: mmap_index_only
-- Setup Schema
CREATE TABLE distributed_test_keyspace.tbl (
pk0 boolean,
ck0 text,
v0 uuid,
v1 float,
v2 tinyint,
v3 ascii,
v4 'org.apache.cassandra.db.marshal.LexicalUUIDType',
PRIMARY KEY (pk0, ck0)
) WITH CLUSTERING ORDER BY (ck0 ASC)
AND additional_write_policy = '99p'
AND allow_auto_snapshot = true
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND cdc = false
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '16', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND memtable = 'default'
AND crc_check_chance = 1.0
AND fast_path = 'keyspace'
AND default_time_to_live = 0
AND extensions = {}
AND gc_grace_seconds = 864000
AND incremental_backups = true
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair = 'BLOCKING'
AND transactional_mode = 'off'
AND transactional_migration_from = 'none'
AND speculative_retry = '99p';
Topology:
Node1: status=Up, tokens=[1353573382]
Node2: status=Up, tokens=[456996056]
CMS Voting Group: [1, 2]
Epochs:
epoch | kind | transformation
16 | BEGIN_CONSENSUS_MIGRATION_FOR_TABLE_AND_RANGE | org.apache.cassandra.tcm.transformations.BeginConsensusMigrationForTableAndRange@68b70cad
15 | SCHEMA_CHANGE | AlterSchema{schemaTransformation=AlterOptions (distributed_test_keyspace, tbl)}
14 | SCHEMA_CHANGE | AlterSchema{schemaTransformation=CreateTableStatement (distributed_test_keyspace, tbl)}
13 | ADVANCE_CMS_RECONFIGURATION | AdvanceCMSReconfiguration{idx=2, current=FinishReconfiguration(), diff=Diff{additions=[], removals=[...
12 | ADVANCE_CMS_RECONFIGURATION | AdvanceCMSReconfiguration{idx=1, current=FinishCMSReconfiguration(), diff=Diff{additions=[], removal...
11 | ADVANCE_CMS_RECONFIGURATION | AdvanceCMSReconfiguration{idx=0, current=StartAddToCMS(NodeId{id=2}), diff=Diff{additions=[NodeId{id...
10 | PREPARE_COMPLEX_CMS_RECONFIGURATION | PrepareCMSReconfiguration#Complex{replicationParams=ReplicationParams{class=org.apache.cassandra.loc...
9 | SCHEMA_CHANGE | AlterSchema{schemaTransformation=CreateKeyspaceStatement (distributed_test_keyspace)}
8 | SCHEMA_CHANGE | AlterSchema{schemaTransformation=AlterKeyspaceStatement (system_traces)}
7 | SCHEMA_CHANGE | AlterSchema{schemaTransformation=AlterKeyspaceStatement (system_auth)}
6 | UNSAFE_JOIN | UnsafeJoin{nodeId=NodeId{id=2}, tokens=[456996056], joinTokenRing=true, streamData=false}
5 | REGISTER | Register{addresses=NodeAddresses{broadcastAddress=/127.0.0.2:7012, localAddress=/127.0.0.2:7012, nat...
4 | UNSAFE_JOIN | UnsafeJoin{nodeId=NodeId{id=1}, tokens=[1353573382], joinTokenRing=true, streamData=false}
3 | REGISTER | Register{addresses=NodeAddresses{broadcastAddress=/127.0.0.1:7012, localAddress=/127.0.0.1:7012, nat...
2 | INITIALIZE_CMS | Initialize{baseState = Epoch{epoch=1}}
1 | PRE_INITIALIZE_CMS | PreInitialize{addr=null}
: org.apache.cassandra.fuzz.topology.AccordTopologyMixupTest.AccordState
History:
1: node1:TXN; epoch=16; Duration PT0.305886666S
2: node1:TXN; epoch=16; Duration PT0.046933292S
3: node1:TXN; epoch=16; Duration PT0.024392083S
4: node2:DELETE; epoch=16; Duration PT0.003137125S
```
##########
test/unit/org/apache/cassandra/cql3/ast/AssignmentOperator.java:
##########
@@ -109,4 +109,14 @@ public AbstractType<?> type()
{
return right.type();
}
+
+ @Override
+ public Expression visit(Visitor v)
+ {
+ var u = v.visit(this);
Review Comment:
Left a comment about this on Visitor - could you add this as a comment on that interface?
##########
test/unit/org/apache/cassandra/cql3/ast/Visitor.java:
##########
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.cql3.ast;
+
+import java.util.List;
+
+public interface Visitor
Review Comment:
Could you add a top-level comment explaining this interface?
##########
test/distributed/org/apache/cassandra/fuzz/topology/AccordTopologyMixupTest.java:
##########
@@ -59,23 +66,38 @@
import org.apache.cassandra.service.accord.api.AccordAgent;
import org.apache.cassandra.service.consensus.TransactionalMode;
import org.apache.cassandra.utils.ASTGenerators;
+import org.apache.cassandra.utils.AbstractTypeGenerators;
import org.apache.cassandra.utils.CassandraGenerators;
+import org.apache.cassandra.utils.FastByteOperations;
+import org.apache.cassandra.utils.Generators;
import org.apache.cassandra.utils.Isolated;
import org.apache.cassandra.utils.Shared;
+import org.quicktheories.generators.SourceDSL;
+import static org.apache.cassandra.utils.AbstractTypeGenerators.overridePrimitiveTypeSupport;
+import static org.apache.cassandra.utils.AbstractTypeGenerators.stringComparator;
import static org.apache.cassandra.utils.AccordGenerators.fromQT;
public class AccordTopologyMixupTest extends TopologyMixupTestBase<AccordTopologyMixupTest.Spec>
{
private static final Logger logger = LoggerFactory.getLogger(AccordTopologyMixupTest.class);
+ /**
+ * Should the history show the CQL? By default, this is off as its very verbose, but when debugging this can be helpful.
+ */
+ private static final boolean HISTORY_SHOWS_CQL = false;
Review Comment:
Would be cool to have this set when a failure is retried, might be worth including some failure retry usability improvements later on. Could also make non-final so it can be set in `AccordTopologyMixupTest#preCheck`, since that method will presumably be used to retry failures with a given seed.
##########
test/harry/main/org/apache/cassandra/harry/cql/SelectHelper.java:
##########
@@ -60,9 +60,9 @@ public static CompiledStatement select(Operations.SelectRow select, SchemaSpec s
for (int i = 0; i < schema.clusteringKeys.size(); i++)
{
ColumnSpec<?> column = schema.clusteringKeys.get(i);
- builder.withWhere(Reference.of(new Symbol(column.name, column.type.asServerType())),
- toInequalities(Relations.RelationKind.EQ),
- new Bind(ck[i], column.type.asServerType()));
+ builder.where(new Symbol(column.name, column.type.asServerType()),
+ toInequalities(Relations.RelationKind.EQ),
Review Comment:
Nit: you renamed to Inequality (singular) elsewhere
##########
test/unit/org/apache/cassandra/utils/ASTGenerators.java:
##########
@@ -76,7 +76,7 @@
public class ASTGenerators
{
- static Gen<Value> valueGen(Object value, AbstractType<?> type)
+ static <T> Gen<Value> valueGen(Object value, AbstractType<?> type)
Review Comment:
Unused type param intentional?
##########
test/unit/org/apache/cassandra/cql3/ast/Select.java:
##########
@@ -270,124 +301,107 @@ public OrderBy build()
}
}
- public static class Builder
+ public static class Builder implements Conditional.ConditionalBuilder<Builder>
{
- private boolean filtering = false;
@Nullable // null means wildcard
private List<Expression> selections = new ArrayList<>();
private Optional<TableReference> source = Optional.empty();
private Conditional.Builder where = new Conditional.Builder();
private OrderBy.Builder orderBy = new OrderBy.Builder();
private Optional<Value> limit = Optional.empty();
+ private boolean allowFiltering = false;
- public Builder withWildcard()
+ public Builder wildcard()
{
if (selections != null && !selections.isEmpty())
throw new IllegalStateException("Attempted to use * for selection but existing selections exist: " + selections);
Review Comment:
TIL we don't support column references and wildcards in the same CQL query (unlike Postgres, for example):
```
> SELECT key, bootstrapped, * FROM system.local;
SyntaxException: line 1:26 no viable alternative at input '*' (SELECT key, bootstrapped, [*]...)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org