[cassandra] branch cassandra-4.0.0 updated (82bd456 -> 3e153c8)

2021-06-09 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 82bd456  Merge branch 'cassandra-3.11' into cassandra-4.0.0
 new 3e153c8  Split ViewComplexTest to avoid timeouts after being moved 
away from 'long' junits

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/ViewComplexDeletionsTest.java   |   3 +-
 .../cassandra/cql3/ViewComplexLivenessTest.java| 258 
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   3 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 180 +--
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   3 +-
 ...Test.java => ViewFilteringClustering1Test.java} | 245 +--
 .../cql3/ViewFilteringClustering2Test.java | 329 +
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |   5 +-
 .../apache/cassandra/cql3/ViewFilteringTest.java   |   5 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   1 +
 .../InsertUpdateIfConditionCollectionsTest.java|   2 +-
 .../InsertUpdateIfConditionStaticsTest.java|   2 +-
 .../operations/InsertUpdateIfConditionTest.java|   2 +-
 13 files changed, 609 insertions(+), 429 deletions(-)
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexLivenessTest.java
 rename test/unit/org/apache/cassandra/cql3/{ViewFilteringClusteringTest.java 
=> ViewFilteringClustering1Test.java} (60%)
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewFilteringClustering2Test.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (3b97e4b -> a56bd76)

2021-06-09 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 3b97e4b  Merge branch 'cassandra-4.0' into trunk
 new 3e153c8  Split ViewComplexTest to avoid timeouts after being moved 
away from 'long' junits
 new 558d4ed  Merge branch 'cassandra-4.0.0' into cassandra-4.0
 new a56bd76  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/ViewComplexDeletionsTest.java   |   3 +-
 .../cassandra/cql3/ViewComplexLivenessTest.java| 258 
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   3 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 180 +--
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   3 +-
 ...Test.java => ViewFilteringClustering1Test.java} | 245 +--
 .../cql3/ViewFilteringClustering2Test.java | 329 +
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |   5 +-
 .../apache/cassandra/cql3/ViewFilteringTest.java   |   5 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   1 +
 .../InsertUpdateIfConditionCollectionsTest.java|   2 +-
 .../InsertUpdateIfConditionStaticsTest.java|   2 +-
 .../operations/InsertUpdateIfConditionTest.java|   2 +-
 13 files changed, 609 insertions(+), 429 deletions(-)
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexLivenessTest.java
 rename test/unit/org/apache/cassandra/cql3/{ViewFilteringClusteringTest.java 
=> ViewFilteringClustering1Test.java} (60%)
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewFilteringClustering2Test.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Split ViewComplexTest to avoid timeouts after being moved away from 'long' junits

2021-06-09 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 3e153c8  Split ViewComplexTest to avoid timeouts after being moved 
away from 'long' junits
 new 558d4ed  Merge branch 'cassandra-4.0.0' into cassandra-4.0
3e153c8 is described below

commit 3e153c88547de4227f2758d15abeadc82a7138fe
Author: Bereng 
AuthorDate: Fri Jun 4 06:53:47 2021 +0200

Split ViewComplexTest to avoid timeouts after being moved away from 'long' 
junits

patch by Berenguer Blas; reviewed by Ekaterina Dimitrova for CASSANDRA-16711
---
 .../cassandra/cql3/ViewComplexDeletionsTest.java   |   3 +-
 .../cassandra/cql3/ViewComplexLivenessTest.java| 258 
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   3 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 180 +--
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   3 +-
 ...Test.java => ViewFilteringClustering1Test.java} | 245 +--
 .../cql3/ViewFilteringClustering2Test.java | 329 +
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |   5 +-
 .../apache/cassandra/cql3/ViewFilteringTest.java   |   5 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   1 +
 .../InsertUpdateIfConditionCollectionsTest.java|   2 +-
 .../InsertUpdateIfConditionStaticsTest.java|   2 +-
 .../operations/InsertUpdateIfConditionTest.java|   2 +-
 13 files changed, 609 insertions(+), 429 deletions(-)

diff --git a/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
index e6662f2..e130378 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
@@ -44,12 +44,13 @@ import static 
org.apache.cassandra.cql3.ViewComplexTest.updateView;
 import static org.apache.cassandra.cql3.ViewComplexTest.updateViewWithFlush;
 import static org.junit.Assert.assertEquals;
 
-/* This class been split into multiple ones bc of timeout issues 
CASSANDRA-16670
+/* ViewComplexTest class has been split into multiple ones because of timeout 
issues (CASSANDRA-16670)
  * Any changes here check if they apply to the other classes:
  * - ViewComplexUpdatesTest
  * - ViewComplexDeletionsTest
  * - ViewComplexTTLTest
  * - ViewComplexTest
+ * - ViewComplexLivenessTest
  */
 @RunWith(Parameterized.class)
 public class ViewComplexDeletionsTest extends CQLTester
diff --git a/test/unit/org/apache/cassandra/cql3/ViewComplexLivenessTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewComplexLivenessTest.java
new file mode 100644
index 000..6999bef
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/ViewComplexLivenessTest.java
@@ -0,0 +1,258 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.transport.ProtocolVersion;
+import org.apache.cassandra.utils.FBUtilities;
+
+import static org.apache.cassandra.cql3.ViewComplexTest.createView;
+import static org.apache.cassandra.cql3.ViewComplexTest.updateView;
+import static org.apache.cassandra.cql3.ViewComplexTest.updateViewWithFlush;
+import static org.junit.Assert.assertEquals;
+
+/* ViewComplexTest class has been split into multiple ones because of timeout 
issues (CASSANDRA-16670)
+ * Any changes here check if they apply to the other classes:
+ * - ViewComplexUpdatesTest
+ * - ViewComplexDeletionsTest
+ * - ViewComplexTTLTest
+ * - ViewComplexTest
+ * - ViewComplexLivenessTest
+ */
+@RunWith(Parameterized.class)
+public class ViewComplexLivenes

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-06-09 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit a56bd764dcb3c3fbb87a9570b94aaa2518f32cfe
Merge: 3b97e4b 558d4ed
Author: Bereng 
AuthorDate: Wed Jun 9 08:48:05 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../cassandra/cql3/ViewComplexDeletionsTest.java   |   3 +-
 .../cassandra/cql3/ViewComplexLivenessTest.java| 258 
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   3 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 180 +--
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   3 +-
 ...Test.java => ViewFilteringClustering1Test.java} | 245 +--
 .../cql3/ViewFilteringClustering2Test.java | 329 +
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |   5 +-
 .../apache/cassandra/cql3/ViewFilteringTest.java   |   5 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   1 +
 .../InsertUpdateIfConditionCollectionsTest.java|   2 +-
 .../InsertUpdateIfConditionStaticsTest.java|   2 +-
 .../operations/InsertUpdateIfConditionTest.java|   2 +-
 13 files changed, 609 insertions(+), 429 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra-dtest] branch trunk updated: Flaky TestConsistency.test_13880

2021-06-07 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 213e87b  Flaky TestConsistency.test_13880
213e87b is described below

commit 213e87b97944dd9f0562c57435ceb42b2b83e07a
Author: Bereng 
AuthorDate: Mon Jun 7 09:50:09 2021 +0200

Flaky TestConsistency.test_13880

patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-16716
---
 consistency_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consistency_test.py b/consistency_test.py
index 906a7b0..0175adf 100644
--- a/consistency_test.py
+++ b/consistency_test.py
@@ -1163,7 +1163,7 @@ class TestConsistency(Tester):
 # with node2 down and hints disabled, delete the partition on node1
 node2.stop(wait_other_notice=True)
 session.execute("DELETE FROM test.test WHERE id = 0;")
-node2.start()
+node2.start(wait_for_binary_proto=True)
 
 # with both nodes up, do a CL.ALL query with per partition limit of 1;
 # prior to CASSANDRA-13880 this would cause short read protection to 
loop forever

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Flaky AlibabaCloudSnitchTest

2021-06-21 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new a4af55f  Flaky AlibabaCloudSnitchTest
 new 1af4c42  Merge branch 'cassandra-4.0.0' into cassandra-4.0
a4af55f is described below

commit a4af55fe2af836904004c4db1aa6a87cea18ee92
Author: Bereng 
AuthorDate: Fri Jun 18 10:25:33 2021 +0200

Flaky AlibabaCloudSnitchTest

patch by Berenguer Blasi; reviewed by Ekaterina Dimitrova for 
CASSANDRA-16750
---
 .../apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java | 3 ++-
 test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java | 1 +
 test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java   | 1 +
 test/unit/org/apache/cassandra/locator/EC2SnitchTest.java  | 1 +
 test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java  | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
 
b/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
index 848c6e0..28462ff 100755
--- 
a/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
+++ 
b/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
@@ -443,7 +443,8 @@ public abstract class AbstractCommitLogSegmentManager
 /**
  * To be used by tests only. Not safe if mutation slots are being 
allocated concurrently.
  */
-void awaitManagementTasksCompletion()
+@VisibleForTesting
+public void awaitManagementTasksCompletion()
 {
 if (availableSegment == null && !atSegmentBufferLimit())
 {
diff --git a/test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java 
b/test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java
index fb85a23..04540cf 100644
--- a/test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java
+++ b/test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java
@@ -48,6 +48,7 @@ public class AlibabaCloudSnitchTest
 System.setProperty(Gossiper.Props.DISABLE_THREAD_VALIDATION, "true");
 DatabaseDescriptor.daemonInitialization();
 CommitLog.instance.start();
+CommitLog.instance.segmentManager.awaitManagementTasksCompletion();
 mkdirs();
 cleanup();
 Keyspace.setInitialized();
diff --git a/test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java 
b/test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java
index 9e39c48..51e8371 100644
--- a/test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java
+++ b/test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java
@@ -49,6 +49,7 @@ public class CloudstackSnitchTest
 System.setProperty(Gossiper.Props.DISABLE_THREAD_VALIDATION, "true");
 DatabaseDescriptor.daemonInitialization();
 CommitLog.instance.start();
+CommitLog.instance.segmentManager.awaitManagementTasksCompletion();
 mkdirs();
 cleanup();
 Keyspace.setInitialized();
diff --git a/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java 
b/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java
index f05f4a2..69c1287 100644
--- a/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java
+++ b/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java
@@ -63,6 +63,7 @@ public class EC2SnitchTest
 System.setProperty(Gossiper.Props.DISABLE_THREAD_VALIDATION, "true");
 DatabaseDescriptor.daemonInitialization();
 CommitLog.instance.start();
+CommitLog.instance.segmentManager.awaitManagementTasksCompletion();
 mkdirs();
 cleanup();
 Keyspace.setInitialized();
diff --git a/test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java 
b/test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java
index e524f3a..67192bd 100644
--- a/test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java
+++ b/test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java
@@ -50,6 +50,7 @@ public class GoogleCloudSnitchTest
 System.setProperty(Gossiper.Props.DISABLE_THREAD_VALIDATION, "true");
 DatabaseDescriptor.daemonInitialization();
 CommitLog.instance.start();
+CommitLog.instance.segmentManager.awaitManagementTasksCompletion();
 mkdirs();
 cleanup();
 Keyspace.setInitialized();

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (ce422e5 -> 968b506)

2021-06-21 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from ce422e5  Merge branch 'cassandra-4.0' into trunk
 new a4af55f  Flaky AlibabaCloudSnitchTest
 new 1af4c42  Merge branch 'cassandra-4.0.0' into cassandra-4.0
 new 968b506  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java | 3 ++-
 test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java | 1 +
 test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java   | 1 +
 test/unit/org/apache/cassandra/locator/EC2SnitchTest.java  | 1 +
 test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java  | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0.0 updated (bdb7c3b -> a4af55f)

2021-06-21 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from bdb7c3b  Merge branch cassandra-3.11 into cassandra-4.0.0
 new a4af55f  Flaky AlibabaCloudSnitchTest

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java | 3 ++-
 test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java | 1 +
 test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java   | 1 +
 test/unit/org/apache/cassandra/locator/EC2SnitchTest.java  | 1 +
 test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java  | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-06-21 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 968b5067228084ffeab1ecc454c3be479984b0fc
Merge: ce422e5 1af4c42
Author: Bereng 
AuthorDate: Mon Jun 21 08:36:18 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java | 3 ++-
 test/unit/org/apache/cassandra/locator/AlibabaCloudSnitchTest.java | 1 +
 test/unit/org/apache/cassandra/locator/CloudstackSnitchTest.java   | 1 +
 test/unit/org/apache/cassandra/locator/EC2SnitchTest.java  | 1 +
 test/unit/org/apache/cassandra/locator/GoogleCloudSnitchTest.java  | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-06-11 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 698078fecf3914b2a5f9d2ea344868f677f5afb2
Merge: 67cab36 1676add
Author: Bereng 
AuthorDate: Fri Jun 11 08:50:44 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../cassandra/service/ActiveRepairServiceTest.java | 40 +-
 1 file changed, 32 insertions(+), 8 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (67cab36 -> 698078f)

2021-06-11 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 67cab36  Merge branch cassandra-4.0 into trunk
 new 23ad7c3  Flaky ActiveRepairServiceTest.testRejectWhenPoolFullStrategy
 new 1676add  Merge branch 'cassandra-4.0.0' into cassandra-4.0
 new 698078f  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/service/ActiveRepairServiceTest.java | 40 +-
 1 file changed, 32 insertions(+), 8 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Flaky ActiveRepairServiceTest.testRejectWhenPoolFullStrategy

2021-06-11 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 23ad7c3  Flaky ActiveRepairServiceTest.testRejectWhenPoolFullStrategy
 new 1676add  Merge branch 'cassandra-4.0.0' into cassandra-4.0
23ad7c3 is described below

commit 23ad7c301e227d5ea88cea0784b32e6351603912
Author: Bereng 
AuthorDate: Fri Jun 11 07:52:05 2021 +0200

Flaky ActiveRepairServiceTest.testRejectWhenPoolFullStrategy

patch by Berenguer Blasi; reviewed by Andres de la Peña and Michael Semb 
Wever for CASSANDRA-16685
---
 .../cassandra/service/ActiveRepairServiceTest.java | 40 +-
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/service/ActiveRepairServiceTest.java 
b/test/unit/org/apache/cassandra/service/ActiveRepairServiceTest.java
index d0a367a..ad680f5 100644
--- a/test/unit/org/apache/cassandra/service/ActiveRepairServiceTest.java
+++ b/test/unit/org/apache/cassandra/service/ActiveRepairServiceTest.java
@@ -18,19 +18,27 @@
 */
 package org.apache.cassandra.service;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.Condition;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.Uninterruptibles;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -55,8 +63,8 @@ import org.apache.cassandra.locator.InetAddressAndPort;
 import org.apache.cassandra.locator.Replica;
 import org.apache.cassandra.locator.TokenMetadata;
 import org.apache.cassandra.repair.messages.RepairOption;
-import org.apache.cassandra.streaming.PreviewKind;
 import org.apache.cassandra.schema.KeyspaceParams;
+import org.apache.cassandra.streaming.PreviewKind;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.concurrent.Refs;
 import org.apache.cassandra.utils.concurrent.SimpleCondition;
@@ -77,6 +85,7 @@ public class ActiveRepairServiceTest
 public static final String KEYSPACE5 = "Keyspace5";
 public static final String CF_STANDARD1 = "Standard1";
 public static final String CF_COUNTER = "Counter1";
+public static final int TASK_SECONDS = 10;
 
 public String cfname;
 public ColumnFamilyStore store;
@@ -376,8 +385,20 @@ public class ActiveRepairServiceTest
 {
 Condition blocked = new SimpleCondition();
 CountDownLatch completed = new CountDownLatch(2);
+
+/*
+ * CASSANDRA-16685 This is a Java bug. When the underlying 
executor's queue is a SynchronousQueue, there can
+ * be races just after the ThreadPool's initialization while 
juggling and spinning up threads internally
+ * leading to false rejections. That queue needs a thread ready to 
pick up the task immediately or it will
+ * produce a reject exception upon 'offer()' method call on the 
executor's code. If the executor is still
+ * initializing or threads are not ready to take work you can get 
false rejections.
+ *
+ * A sleep has been added to give time to the thread pool to be 
ready to get work.
+ */
+Thread.sleep(250);
 validationExecutor.submit(new Task(blocked, completed));
 validationExecutor.submit(new Task(blocked, completed));
+
 try
 {
 validationExecutor.submit(new Task(blocked, completed));
@@ -387,10 +408,13 @@ public class ActiveRepairServiceTest
 {
 // expected
 }
+
 // allow executing tests to complete
 blocked.signalAll();
-completed.await(10, TimeUnit.SECONDS);
+completed.await(TASK_SECONDS + 1, TimeUnit.SECONDS);
+
 // Submission is unblocked
+Thread.sleep(250);
 validationExecutor.submit(() -> {});
 }
 finally
@@ -425,7 +449,7 @@ public class ActiveRepairServiceTest
 }
 
 // Make sure all tasks have been submitted to the validation 
executor
-allSubmitted.await(10, TimeUnit.SECONDS);
+allSubmitted.await(T

[cassandra] branch cassandra-4.0.0 updated (2059c75 -> 23ad7c3)

2021-06-11 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 2059c75  Fix queries on empty partitions with static data
 new 23ad7c3  Flaky ActiveRepairServiceTest.testRejectWhenPoolFullStrategy

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/service/ActiveRepairServiceTest.java | 40 +-
 1 file changed, 32 insertions(+), 8 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Fix typo

2021-05-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 8a6dc6a  Fix typo
8a6dc6a is described below

commit 8a6dc6a723778374f6db626fa07d242c6dca59e8
Author: Bereng 
AuthorDate: Mon May 10 12:19:23 2021 +0200

Fix typo

patch by Berenguer Blasi; reviewed by Ekaterina Dimitrova for 
CASSANDRA-16661
---
 .../org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/java/org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java
index 9228f34..a9887c4 100644
--- 
a/src/java/org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java
+++ 
b/src/java/org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java
@@ -193,7 +193,7 @@ public abstract class AlterTypeStatement extends 
AlterSchemaStatement
 
 UserType apply(KeyspaceMetadata keyspace, UserType userType)
 {
-throw ire("Alterting field types is no longer supported");
+throw ire("Altering field types is no longer supported");
 }
 }
 

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (8975a4f -> 8fb105f)

2021-05-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 8975a4f  Merge branch 'cassandra-4.0' into trunk
 new 8a6dc6a  Fix typo
 new 8fb105f  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-05-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 8fb105f26966ba5d9ec1af5cab8e4b1a933c218c
Merge: 8975a4f 8a6dc6a
Author: Bereng 
AuthorDate: Tue May 11 07:05:01 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/cql3/statements/schema/AlterTypeStatement.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra-dtest] branch trunk updated: Flaky TestTransientReplicationRing.test_move_backwards_and_cleanup

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
 new a3b24d7  Flaky 
TestTransientReplicationRing.test_move_backwards_and_cleanup
a3b24d7 is described below

commit a3b24d7617bff1eb9aa1a30474f09b211ea4c1db
Author: Bereng 
AuthorDate: Mon May 10 07:28:56 2021 +0200

Flaky TestTransientReplicationRing.test_move_backwards_and_cleanup

patch by Berenguer Blasi; reviewed by Ekaterina Dimitrova for 
CASSANDRA-16644
---
 transient_replication_ring_test.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/transient_replication_ring_test.py 
b/transient_replication_ring_test.py
index 32a595a..5a20952 100644
--- a/transient_replication_ring_test.py
+++ b/transient_replication_ring_test.py
@@ -3,7 +3,9 @@ import types
 
 from cassandra import ConsistencyLevel
 from cassandra.query import SimpleStatement
+from ccmlib.cluster import DEFAULT_CLUSTER_WAIT_TIMEOUT_IN_SECS
 from ccmlib.node import Node
+from ccmlib.node import NODE_WAIT_TIMEOUT_IN_SECS
 
 from dtest import Tester
 from tools.assertions import (assert_all)
@@ -116,7 +118,8 @@ class TestTransientReplicationRing(Tester):
 print(self.cluster.get_install_dir())
 self.cluster.populate(3, tokens=self.tokens, debug=True, 
install_byteman=True)
 # self.cluster.populate(3, debug=True, install_byteman=True)
-
self.cluster.start(jvm_args=['-Dcassandra.enable_nodelocal_queries=true'])
+
self.cluster.start(jvm_args=['-Dcassandra.enable_nodelocal_queries=true'],
+   timeout=DEFAULT_CLUSTER_WAIT_TIMEOUT_IN_SECS * 2)
 
 # enable shared memory
 for node in self.cluster.nodelist():
@@ -226,13 +229,12 @@ class TestTransientReplicationRing(Tester):
 # Every value should be replicated exactly 2 times
 self.check_replication(sessions, exactly=2)
 
-@flaky(max_runs=1)
 @pytest.mark.no_vnodes
 def move_test(self, move_token, expected_after_move, 
expected_after_repair):
 """Helper method to run a move test cycle"""
 node4 = new_node(self.cluster, bootstrap=True, token='00040')
 patch_start(node4)
-node4.start(wait_for_binary_proto=True)
+node4.start(wait_for_binary_proto=NODE_WAIT_TIMEOUT_IN_SECS * 2)
 main_session = self.patient_cql_connection(self.node1)
 nodes = [self.node1, self.node2, self.node3, node4]
 
@@ -392,7 +394,6 @@ class TestTransientReplicationRing(Tester):
 self.check_expected(sessions, expected, nodes, cleanup=True)
 self.check_replication(sessions, exactly=2)
 
-@flaky(max_runs=1)
 @pytest.mark.no_vnodes
 def test_remove(self):
 """Test  a mix of ring change operations across a mix of transient and 
repaired/unrepaired data"""
@@ -432,7 +433,6 @@ class TestTransientReplicationRing(Tester):
 
 self._nodes_have_proper_ranges_after_repair_and_cleanup(sessions)
 
-@flaky(max_runs=1)
 @pytest.mark.no_vnodes
 def test_replace(self):
 main_session = self.patient_cql_connection(self.node1)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra-dtest] branch trunk updated: Add 4_0_x to Python DTest's upgrade_manifest

2021-05-07 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
 new bfd6bed  Add 4_0_x to Python DTest's upgrade_manifest
bfd6bed is described below

commit bfd6bed9cc9d2cb3a93f67b60bd4ce5e87515b86
Author: Bereng 
AuthorDate: Tue May 4 10:06:44 2021 +0200

Add 4_0_x to Python DTest's upgrade_manifest

patch by Berenguer Blasi; reviewed by Mick Semb Wever for CASSANDRA-16648

Co-authored-by: Mick Semb Wever 
Co-authored-by: Bereng 
---
 upgrade_tests/cql_tests.py| 20 ++--
 upgrade_tests/paging_test.py  |  4 ++--
 upgrade_tests/upgrade_manifest.py | 20 ++--
 3 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/upgrade_tests/cql_tests.py b/upgrade_tests/cql_tests.py
index 12f1d59..c2bfe99 100644
--- a/upgrade_tests/cql_tests.py
+++ b/upgrade_tests/cql_tests.py
@@ -5499,12 +5499,20 @@ class TestCQL(UpgradeTester):
 cursor.execute("CREATE KEYSPACE foo WITH replication = {'class': 
'SimpleStrategy', 'replication_factor': 1}")
 cursor.execute("CREATE TABLE foo.test1 (k int, t int, v int, PRIMARY 
KEY(k, t))")
 
-cursor.execute("""
-CREATE MATERIALIZED VIEW foo.view1
-AS SELECT * FROM foo.test1
-WHERE v IS NOT NULL AND t IS NOT NULL
-PRIMARY KEY (k, v, t)
-""")
+if self.is_40_or_greater():
+cursor.execute("""
+CREATE MATERIALIZED VIEW foo.view1
+AS SELECT * FROM foo.test1
+WHERE k IS NOT NULL AND v IS NOT NULL AND t IS NOT NULL
+PRIMARY KEY (k, v, t)
+""")
+else:
+cursor.execute("""
+CREATE MATERIALIZED VIEW foo.view1
+AS SELECT * FROM foo.test1
+WHERE v IS NOT NULL AND t IS NOT NULL
+PRIMARY KEY (k, v, t)
+""")
 
 for i in range(0, 10):
 cursor.execute("INSERT INTO foo.test1(k, t, v) VALUES (0, %d, %d)" 
% (i, 10 - i - 1))
diff --git a/upgrade_tests/paging_test.py b/upgrade_tests/paging_test.py
index 06c5dfd..7c3bd37 100644
--- a/upgrade_tests/paging_test.py
+++ b/upgrade_tests/paging_test.py
@@ -480,7 +480,7 @@ class TestPagingData(BasePagingTester, PageAssertionMixin):
 if testing_compact_storage:
 cursor.execute("TRUNCATE test2")
 
-tables = ("test", "test2") if testing_compact_storage else ("test")
+tables = ["test", "test2"] if testing_compact_storage else ["test"]
 for table in tables:
 logger.debug("Querying table %s" % (table,))
 expected = []
@@ -534,7 +534,7 @@ class TestPagingData(BasePagingTester, PageAssertionMixin):
 if testing_compact_storage:
   cursor.execute("TRUNCATE test2")
 
-tables = ("test", "test2") if testing_compact_storage else ("test")
+tables = ["test", "test2"] if testing_compact_storage else ["test"]
 for table in tables:
 logger.debug("Querying table %s" % (table,))
 expected = []
diff --git a/upgrade_tests/upgrade_manifest.py 
b/upgrade_tests/upgrade_manifest.py
index 6d4ad5e..7cf4910 100644
--- a/upgrade_tests/upgrade_manifest.py
+++ b/upgrade_tests/upgrade_manifest.py
@@ -26,7 +26,8 @@ CASSANDRA_2_2 = '2.2'
 CASSANDRA_3_0 = '3.0'
 CASSANDRA_3_11 = '3.11'
 CASSANDRA_4_0 = '4.0'
-TRUNK = CASSANDRA_4_0
+CASSANDRA_4_1 = '4.1'
+TRUNK = CASSANDRA_4_1
 
 def is_same_family_current_to_indev(origin, destination):
 """
@@ -97,6 +98,8 @@ def set_version_family():
 version_family = CASSANDRA_3_11
 elif current_version.vstring.startswith('4.0'):
 version_family = CASSANDRA_4_0
+elif current_version.vstring.startswith('4.1'):
+version_family = CASSANDRA_4_1
 else:
 # when this occurs, it's time to update this manifest a bit!
 raise RuntimeError("Testing upgrades from/to version %s is not 
supported. Please use a custom manifest (see upgrade_manifest.py)" % 
current_version.vstring)
@@ -154,7 +157,10 @@ indev_3_0_x = VersionMeta(name='indev_3_0_x', 
family=CASSANDRA_3_0, variant='ind
 current_3_0_x = VersionMeta(name='current_3_0_x', family=CASSANDRA_3_0, 
variant='current', version='3.0.24', min_proto_v=3, max_proto_v=4, 
java_versions=(8,))
 
 indev_3_11_x = VersionMeta(name='indev_3_11_x', family=CASSANDRA_3_11, 
variant='indev', version='github:apache/cassandra-3.11', min_proto_v=3, 
max_pro

[cassandra] branch trunk updated (f55baa4 -> 2a1e537)

2021-05-06 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from f55baa4  Merge branch 'cassandra-4.0' into trunk
 new 7e4c77c  Flaky DirectoriesTest.testSecondaryIndexDirectories
 new 2a1e537  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/db/DirectoriesTest.java   | 34 --
 1 file changed, 18 insertions(+), 16 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Flaky DirectoriesTest.testSecondaryIndexDirectories

2021-05-06 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 7e4c77c  Flaky DirectoriesTest.testSecondaryIndexDirectories
7e4c77c is described below

commit 7e4c77c96887ac6f99b044b759495121024b582b
Author: Bereng 
AuthorDate: Wed May 5 10:53:54 2021 +0200

Flaky DirectoriesTest.testSecondaryIndexDirectories

patch by Berenguer Blasi; reviewed by Benjamin Lerer for CASSANDRA-16627
---
 .../org/apache/cassandra/db/DirectoriesTest.java   | 34 --
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/test/unit/org/apache/cassandra/db/DirectoriesTest.java 
b/test/unit/org/apache/cassandra/db/DirectoriesTest.java
index 507827e..9756635 100644
--- a/test/unit/org/apache/cassandra/db/DirectoriesTest.java
+++ b/test/unit/org/apache/cassandra/db/DirectoriesTest.java
@@ -29,7 +29,9 @@ import java.util.concurrent.Future;
 
 import com.google.common.collect.Sets;
 import org.apache.commons.lang3.StringUtils;
+
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -65,18 +67,23 @@ public class DirectoriesTest
 {
 private static File tempDataDir;
 private static final String KS = "ks";
-private static final String[] TABLES = new String[] { "cf1", "ks" };
-
-private static final Set CFM = new HashSet<>(TABLES.length);
-
-private static final Map> files = new HashMap<>();
+private static String[] TABLES;
+private static Set CFM;
+private static Map> files;
 
 @BeforeClass
-public static void beforeClass() throws IOException
+public static void beforeClass()
 {
 DatabaseDescriptor.daemonInitialization();
-
 FileUtils.setFSErrorHandler(new DefaultFSErrorHandler());
+}
+
+@Before
+public void beforeTest() throws IOException
+{
+TABLES = new String[] { "cf1", "ks" };
+CFM = new HashSet<>(TABLES.length);
+files = new HashMap<>();
 
 for (String table : TABLES)
 {
@@ -100,7 +107,7 @@ public class DirectoriesTest
 FileUtils.deleteRecursive(tempDataDir);
 }
 
-private static DataDirectory[] toDataDirectories(File location) throws 
IOException
+private static DataDirectory[] toDataDirectories(File location)
 {
 return new DataDirectory[] { new DataDirectory(location) };
 }
@@ -174,7 +181,7 @@ public class DirectoriesTest
 }
 
 @Test
-public void testSecondaryIndexDirectories() throws IOException
+public void testSecondaryIndexDirectories()
 {
 TableMetadata.Builder builder =
 TableMetadata.builder(KS, "cf")
@@ -208,14 +215,9 @@ public class DirectoriesTest
 assertEquals(parentSnapshotDirectory, 
indexSnapshotDirectory.getParentFile());
 
 // check if snapshot directory exists
-parentSnapshotDirectory.mkdirs();
 assertTrue(parentDirectories.snapshotExists("test"));
 assertTrue(indexDirectories.snapshotExists("test"));
 
-// check their creation time
-assertEquals(parentDirectories.snapshotCreationTime("test"),
- indexDirectories.snapshotCreationTime("test"));
-
 // check true snapshot size
 Descriptor parentSnapshot = new Descriptor(parentSnapshotDirectory, 
KS, PARENT_CFM.name, 0, SSTableFormat.Type.BIG);
 createFile(parentSnapshot.filenameFor(Component.DATA), 30);
@@ -253,7 +255,7 @@ public class DirectoriesTest
 }
 
 @Test
-public void testSSTableLister() throws IOException
+public void testSSTableLister()
 {
 for (TableMetadata cfm : CFM)
 {
@@ -622,7 +624,7 @@ public class DirectoriesTest
 }
 
 @Test
-public void testIsStoredInLocalSystemKeyspacesDataLocation() throws 
IOException
+public void testIsStoredInLocalSystemKeyspacesDataLocation()
 {
 for (String table : SystemKeyspace.TABLES_SPLIT_ACROSS_MULTIPLE_DISKS)
 {

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-05-06 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 2a1e53785593571fd7da7a47534b25a1f318e76c
Merge: f55baa4 7e4c77c
Author: Bereng 
AuthorDate: Thu May 6 10:02:17 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/db/DirectoriesTest.java   | 34 --
 1 file changed, 18 insertions(+), 16 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated (1e42c10 -> 317a4a8)

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 1e42c10  Merge branch 'cassandra-3.0' into cassandra-3.11
 new fdabda1  patch by Berenguer Blasi; reviewed by Andrés de la Peña for 
CASSANDRA-16654
 new 317a4a8  Merge branch 'cassandra-3.0' into cassandra-3.11

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/source/development/testing.rst |   5 +
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 2 files changed, 114 insertions(+)
 create mode 100644 test/unit/org/apache/cassandra/RepeatableRunner.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.0 updated: patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16654

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.0 by this push:
 new fdabda1  patch by Berenguer Blasi; reviewed by Andrés de la Peña for 
CASSANDRA-16654
fdabda1 is described below

commit fdabda1da849efdb2f0066a341b9cc24de7fd05c
Author: Bereng 
AuthorDate: Mon May 17 09:45:24 2021 +0200

patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16654

Co-authored-by: Andrés de la Peña 
Co-authored-by: Bereng 
---
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 1 file changed, 109 insertions(+)

diff --git a/test/unit/org/apache/cassandra/RepeatableRunner.java 
b/test/unit/org/apache/cassandra/RepeatableRunner.java
new file mode 100644
index 000..75f3331
--- /dev/null
+++ b/test/unit/org/apache/cassandra/RepeatableRunner.java
@@ -0,0 +1,109 @@
+/*
+ * 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;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.internal.builders.AllDefaultPossibilitiesBuilder;
+import org.junit.runner.Description;
+import org.junit.runner.Runner;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.RunnerBuilder;
+
+/**
+ * This class comes useful when debugging flaky tests that will fail only when 
the full test suite is ran. It is
+ * intended for test failure investigation only.
+ * 
+ * Decorate your class with the runner and iterations you want. Defaults to 10.
+ * Beware of tests that change singleton status as those won't work.
+ * {@code
+ * @RunWith(RepeatableRunner.class)
+ * @RepeatableRunnerConfiguration(iterations = 2, runner = 
BlockJUnit4ClassRunner.class)
+ * public class MyTest
+ * {
+ * ...
+ * }
+ * }
+ */
+public class RepeatableRunner extends Runner
+{
+private static final int DEFAULT_REPETITIONS = 10;
+private static final Class DEFAULT_RUNNER_CLASS = 
BlockJUnit4ClassRunner.class;
+
+private final Runner runner;
+private final int iterations;
+
+public RepeatableRunner(Class testClass) throws Throwable
+{
+Class runnerClass = DEFAULT_RUNNER_CLASS;
+
+if (testClass.isAnnotationPresent(RepeatableRunnerConfiguration.class))
+{
+RepeatableRunnerConfiguration configuration = 
testClass.getAnnotation(RepeatableRunnerConfiguration.class);
+iterations = configuration.iterations();
+runnerClass = configuration.runner();
+}
+else
+{
+iterations = DEFAULT_REPETITIONS;
+}
+
+runner = buildRunner(runnerClass, testClass);
+}
+
+@Override
+public Description getDescription()
+{
+return runner.getDescription();
+}
+
+@Override
+public void run(RunNotifier notifier)
+{
+for (int i = 0; i < iterations; i++)
+{
+runner.run(notifier);
+}
+}
+
+private static Runner buildRunner(Class runnerClass, 
Class testClass) throws Throwable
+{
+try
+{
+return 
runnerClass.getConstructor(Class.class).newInstance(testClass);
+}
+catch (NoSuchMethodException e)
+{
+return runnerClass.getConstructor(Class.class, RunnerBuilder.class)
+  .newInstance(testClass, new 
AllDefaultPossibilitiesBuilder(true));
+}
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface RepeatableRunnerConfiguration
+{
+int iterations() default DEFAULT_REPETITIONS;
+
+Class runner() default BlockJUnit4ClassRunner.class;
+}
+}

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.0' into cassandra-3.11

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 317a4a864c2c3bdb1d82f97d0c0d724f11e7efe2
Merge: 1e42c10 fdabda1
Author: Bereng 
AuthorDate: Tue May 18 06:38:10 2021 +0200

Merge branch 'cassandra-3.0' into cassandra-3.11

 doc/source/development/testing.rst |   5 +
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 2 files changed, 114 insertions(+)

diff --cc doc/source/development/testing.rst
index 0f91629,000..2ec1631
mode 100644,00..100644
--- a/doc/source/development/testing.rst
+++ b/doc/source/development/testing.rst
@@@ -1,134 -1,0 +1,139 @@@
 +.. 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.
 +
 +.. highlight:: none
 +
 +Testing
 +***
 +
 +Creating tests is one of the most important and also most difficult parts of 
developing Cassandra. There are different ways to test your code depending on 
what you're working on.
 +
 +
 +Unit Testing
 +
 +
 +The most simple way to test code in Cassandra is probably by writing a unit 
test. Cassandra uses JUnit as a testing framework and test cases can be found 
in the ``test/unit`` directory. Ideally you’d be able to create a unit test for 
your implementation that would exclusively cover the class you created (the 
unit under test). Unfortunately this is not always possible and Cassandra 
doesn’t have a very mock friendly code base. Often you’ll find yourself in a 
situation where you have to ma [...]
 +
 +.. code-block:: java
 +
 +  @Test
 +  public void testBatchAndList() throws Throwable
 +  {
 + createTable("CREATE TABLE %s (k int PRIMARY KEY, l list)");
 + execute("BEGIN BATCH " +
 + "UPDATE %1$s SET l = l +[ 1 ] WHERE k = 0; " +
 + "UPDATE %1$s SET l = l + [ 2 ] WHERE k = 0; " +
 + "UPDATE %1$s SET l = l + [ 3 ] WHERE k = 0; " +
 + "APPLY BATCH");
 +
 + assertRows(execute("SELECT l FROM %s WHERE k = 0"),
 +row(list(1, 2, 3)));
 +  }
 +
 +Unit tests can be run from the command line using the ``ant test`` command, 
``ant test -Dtest.name=`` to execute a test suite or ``ant 
testsome -Dtest.name= -Dtest.methods=[,testmethod2]`` for 
individual tests.  For example, to run all test methods in the 
``org.apache.cassandra.cql3.SimpleQueryTest`` class, you would run::
 +
 +ant test -Dtest.name=SimpleQueryTest
 +
 +To run only the ``testStaticCompactTables()`` test method from that class, 
you would run::
 +
 +ant testsome -Dtest.name=org.apache.cassandra.cql3.SimpleQueryTest 
-Dtest.methods=testStaticCompactTables
 +
 +Long running tests
 +--
 +
 +Test that consume a significant amount of time during execution can be found 
in the ``test/long`` directory and executed as a regular JUnit test or 
standalone program. Except for the execution time, there’s nothing really 
special about them. However, ant will execute tests under ``test/long`` only 
when using the ``ant long-test`` target.
 +
++Flaky tests
++---
++
++If a test failure is difficult to reproduce you can always use a shell loop, 
circle repeat strategy and similar solutions. At the JUnit level 
``RepeatableRunner`` will let you run a JUnit class N times for convenience. On 
tests that are fast this is a much faster way to iterate than doing it at the 
shell level. Beware of tests that modify singleton state or similar as they 
won't work.
++
 +DTests
 +==
 +
 +One way of doing integration or system testing at larger scale is by using 
`dtest <https://github.com/riptano/cassandra-dtest>`_, which stands for 
“Cassandra Distributed Tests”. The idea is to automatically setup Cassandra 
clusters using various configurations and simulate certain use cases you want 
to test. This is done using Python scripts and ``ccmlib`` from the `ccm 
<https://github.com/pcmanus/ccm>`_ project. Dtests will setup clusters using 
this library just as you do running ad-ho [...]
 +
 +Using dtests helps us to prevent regression bugs

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 5d2c2f5ee39d7cd0a9bf419ce577735e25914424
Merge: d997b49 2ca525b
Author: Bereng 
AuthorDate: Tue May 18 06:41:22 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 doc/source/development/testing.rst |   5 +
 .../CassandraIsolatedJunit4ClassRunner.java|   2 -
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 3 files changed, 114 insertions(+), 2 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (0301fc6 -> 2ca525b)

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 0301fc6  cqlsh: fix DESC TYPE with non-ascii character in the 
identifier
 new fdabda1  patch by Berenguer Blasi; reviewed by Andrés de la Peña for 
CASSANDRA-16654
 new 317a4a8  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 2ca525b  Merge branch 'cassandra-3.11' into cassandra-4.0

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/source/development/testing.rst |   5 +
 .../CassandraIsolatedJunit4ClassRunner.java|   2 -
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 3 files changed, 114 insertions(+), 2 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/RepeatableRunner.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (d997b49 -> 5d2c2f5)

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from d997b49  Merge branch 'cassandra-4.0' into trunk
 new fdabda1  patch by Berenguer Blasi; reviewed by Andrés de la Peña for 
CASSANDRA-16654
 new 317a4a8  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 2ca525b  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 5d2c2f5  Merge branch 'cassandra-4.0' into trunk

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/source/development/testing.rst |   5 +
 .../CassandraIsolatedJunit4ClassRunner.java|   2 -
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 3 files changed, 114 insertions(+), 2 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/RepeatableRunner.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-05-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 2ca525b6b7aaac08ce311bcc70587a35881f559a
Merge: 0301fc6 317a4a8
Author: Bereng 
AuthorDate: Tue May 18 06:39:53 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 doc/source/development/testing.rst |   5 +
 .../CassandraIsolatedJunit4ClassRunner.java|   2 -
 .../org/apache/cassandra/RepeatableRunner.java | 109 +
 3 files changed, 114 insertions(+), 2 deletions(-)

diff --cc test/unit/org/apache/cassandra/CassandraIsolatedJunit4ClassRunner.java
index 90e3896,000..8c37be7
mode 100644,00..100644
--- a/test/unit/org/apache/cassandra/CassandraIsolatedJunit4ClassRunner.java
+++ b/test/unit/org/apache/cassandra/CassandraIsolatedJunit4ClassRunner.java
@@@ -1,109 -1,0 +1,107 @@@
 +/*
 + * 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;
 +
 +import java.io.IOException;
 +import java.net.URLClassLoader;
 +import java.util.function.Predicate;
 +
 +import org.junit.runners.BlockJUnit4ClassRunner;
 +import org.junit.runners.model.InitializationError;
 +
 +import org.apache.cassandra.distributed.impl.AbstractCluster;
- import org.apache.cassandra.distributed.shared.Versions;
- import org.apache.cassandra.utils.FBUtilities;
 +
 +/**
 + *
 + * This class is usually used to test singletons. It ensure singletons can be 
unique in each test case.
 + *
 + */
 +public class CassandraIsolatedJunit4ClassRunner extends BlockJUnit4ClassRunner
 +{
 +
 +private static final Predicate isolatedPackage = name ->
 + 
name.startsWith("org.apache.cassandra.") ||
 + // YAML could 
not be shared because
 + // 
org.apache.cassandra.config.Config is loaded by org.yaml.snakeyaml.YAML
 + 
name.startsWith("org.yaml.snakeyaml.");
 +
 +
 +/**
 + * Creates a CassandraIsolatedJunit4ClassRunner to run {@code klass}
 + *
 + * @param clazz
 + * @throws InitializationError if the test class is malformed.
 + */
 +public CassandraIsolatedJunit4ClassRunner(Class clazz) throws 
InitializationError
 +{
 +super(createClassLoader(clazz));
 +}
 +
 +private static Class createClassLoader(Class clazz) throws 
InitializationError {
 +try {
 +ClassLoader testClassLoader = new CassandraIsolatedClassLoader();
 +return Class.forName(clazz.getName(), true, testClassLoader);
 +} catch (ClassNotFoundException e) {
 +throw new InitializationError(e);
 +}
 +}
 +
 +public static class CassandraIsolatedClassLoader extends URLClassLoader
 +{
 +public CassandraIsolatedClassLoader()
 +{
 +super(AbstractCluster.CURRENT_VERSION.classpath);
 +}
 +
 +@Override
 +public Class loadClass(String name) throws ClassNotFoundException
 +{
 +
 +if (isolatedPackage.test(name))
 +{
 +synchronized (getClassLoadingLock(name))
 +{
 +// First, check if the class has already been loaded
 +Class c = findLoadedClass(name);
 +
 +if (c == null)
 +c = findClass(name);
 +
 +return c;
 +}
 +}
 +else
 +{
 +return super.loadClass(name);
 +}
 +}
 +
 +protected void finalize()
 +{
 +try
 +{
 +close();
 +}
 +catch (IOException e)
 +{
 +e.printStackTrace();
 +}
 +}
 +}
 +}

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org

[cassandra-dtest] branch trunk updated: Flaky TestPaxos.test_replica_availability

2021-05-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
 new c67b12d  Flaky TestPaxos.test_replica_availability
c67b12d is described below

commit c67b12d14d75a70336b7b7fef8d4f81d80e32124
Author: Bereng 
AuthorDate: Tue May 25 08:46:07 2021 +0200

Flaky TestPaxos.test_replica_availability

patch by Berenguer Blasi; reviewed by Ekaterina Dimitrova for 
CASSANDRA-16693
---
 paxos_test.py | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/paxos_test.py b/paxos_test.py
index 457b74f..5265be4 100644
--- a/paxos_test.py
+++ b/paxos_test.py
@@ -48,16 +48,19 @@ class TestPaxos(Tester):
 session.execute("CREATE TABLE test (k int PRIMARY KEY, v int)")
 session.execute("INSERT INTO test (k, v) VALUES (0, 0) IF NOT EXISTS")
 
-self.cluster.nodelist()[2].stop()
+node1 = self.cluster.nodelist()[1]
+node2 = self.cluster.nodelist()[2]
+
+node2.stop()
 session.execute("INSERT INTO test (k, v) VALUES (1, 1) IF NOT EXISTS")
 
-self.cluster.nodelist()[1].stop()
+node1.stop()
 assert_unavailable(session.execute, "INSERT INTO test (k, v) VALUES 
(2, 2) IF NOT EXISTS")
 
-self.cluster.nodelist()[1].start()
+node1.start(wait_for_binary_proto=True)
 session.execute("INSERT INTO test (k, v) VALUES (3, 3) IF NOT EXISTS")
 
-self.cluster.nodelist()[2].start()
+node2.start(wait_for_binary_proto=True)
 session.execute("INSERT INTO test (k, v) VALUES (4, 4) IF NOT EXISTS")
 
 @pytest.mark.no_vnodes

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-06-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 2316a9b7f116546d1c839bdcd77ef2f2c7288e24
Merge: 3af9b0a 6ad2592
Author: Bereng 
AuthorDate: Wed Jun 2 09:33:22 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/cql3/ViewComplexTest.java | 1450 -
 .../apache/cassandra/cql3/ViewFilteringTest.java   | 2167 
 .../cassandra/cql3/ViewComplexDeletionsTest.java   |  501 +
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |  277 +++
 .../org/apache/cassandra/cql3/ViewComplexTest.java |  609 ++
 .../cassandra/cql3/ViewComplexUpdatesTest.java |  372 
 .../cql3/ViewFilteringClusteringTest.java  |  662 ++
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |  656 ++
 .../apache/cassandra/cql3/ViewFilteringTest.java   | 1044 ++
 .../InsertUpdateIfConditionCollectionsTest.java|  921 +
 .../InsertUpdateIfConditionStaticsTest.java|  379 
 .../operations/InsertUpdateIfConditionTest.java| 1512 +-
 12 files changed, 5433 insertions(+), 5117 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (3af9b0a -> 2316a9b)

2021-06-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 3af9b0a  Merge branch 'cassandra-4.0' into trunk
 new 6ad2592  Flaky ViewComplexTest, ViewFilteringTest and 
InsertUpdateIfConditionTest
 new 2316a9b  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 1450 -
 .../apache/cassandra/cql3/ViewFilteringTest.java   | 2167 
 .../cassandra/cql3/ViewComplexDeletionsTest.java   |  501 +
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |  277 +++
 .../org/apache/cassandra/cql3/ViewComplexTest.java |  609 ++
 .../cassandra/cql3/ViewComplexUpdatesTest.java |  372 
 .../cql3/ViewFilteringClusteringTest.java  |  662 ++
 .../apache/cassandra/cql3/ViewFilteringPKTest.java |  656 ++
 .../apache/cassandra/cql3/ViewFilteringTest.java   | 1044 ++
 .../InsertUpdateIfConditionCollectionsTest.java|  921 +
 .../InsertUpdateIfConditionStaticsTest.java|  379 
 .../operations/InsertUpdateIfConditionTest.java| 1512 +-
 12 files changed, 5433 insertions(+), 5117 deletions(-)
 delete mode 100644 test/long/org/apache/cassandra/cql3/ViewComplexTest.java
 delete mode 100644 test/long/org/apache/cassandra/cql3/ViewFilteringTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewComplexTTLTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewComplexTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexUpdatesTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewFilteringClusteringTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewFilteringPKTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewFilteringTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/validation/operations/InsertUpdateIfConditionCollectionsTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/validation/operations/InsertUpdateIfConditionStaticsTest.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Flaky ViewTest patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-16777

2021-07-05 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 6d16a53  Flaky ViewTest patch by Berenguer Blasi; reviewed by Andres 
de la Peña for CASSANDRA-16777
 new ba0f622  Merge branch 'cassandra-4.0.0' into cassandra-4.0
6d16a53 is described below

commit 6d16a531b1b4b3d63dfa182cd8484fb4d9e93c86
Author: Bereng 
AuthorDate: Thu Jul 1 07:52:46 2021 +0200

Flaky ViewTest
patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-16777
---
 .../apache/cassandra/cql3/ViewAbstractTest.java| 108 +++
 .../unit/org/apache/cassandra/cql3/ViewPKTest.java | 461 +++
 .../org/apache/cassandra/cql3/ViewRangesTest.java  | 197 +
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 917 +
 .../org/apache/cassandra/cql3/ViewTimesTest.java   | 300 +++
 5 files changed, 1076 insertions(+), 907 deletions(-)

diff --git a/test/unit/org/apache/cassandra/cql3/ViewAbstractTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewAbstractTest.java
new file mode 100644
index 000..bbd21dc
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/ViewAbstractTest.java
@@ -0,0 +1,108 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+
+import com.datastax.driver.core.exceptions.OperationTimedOutException;
+import org.apache.cassandra.concurrent.Stage;
+import org.awaitility.Awaitility;
+
+@Ignore
+public abstract class ViewAbstractTest extends CQLTester
+{
+protected final List views = new ArrayList<>();
+
+@BeforeClass
+public static void startup()
+{
+requireNetwork();
+}
+
+@Before
+public void begin()
+{
+begin(views);
+}
+
+private static void begin(List views)
+{
+views.clear();
+}
+
+@After
+public void end() throws Throwable
+{
+end(views, this);
+}
+
+private static void end(List views, CQLTester tester) throws 
Throwable
+{
+for (String viewName : views)
+tester.executeNet("DROP MATERIALIZED VIEW " + viewName);
+}
+
+protected void createView(String name, String query) throws Throwable
+{
+createView(name, query, views, this);
+}
+
+private static void createView(String name, String query, List 
views, CQLTester tester) throws Throwable
+{
+try
+{
+tester.executeNet(String.format(query, name));
+// If exception is thrown, the view will not be added to the list; 
since it shouldn't have been created, this is
+// the desired behavior
+views.add(name);
+}
+catch (OperationTimedOutException ex)
+{
+// ... except for timeout, when we actually do not know whether 
the view was created or not
+views.add(name);
+throw ex;
+}
+}
+
+protected void updateView(String query, Object... params) throws Throwable
+{
+updateView(query, this, params);
+}
+
+private static void updateView(String query, CQLTester tester, Object... 
params) throws Throwable
+{
+tester.executeNet(query, params);
+waitForViewMutations();
+}
+
+protected static void waitForViewMutations()
+{
+Awaitility.await()
+  .atMost(5, TimeUnit.MINUTES)
+  .until(() -> 
Stage.VIEW_MUTATION.executor().getPendingTaskCount() == 0
+   && 
Stage.VIEW_MUTATION.executor().getActiveTaskCount() == 0);
+}
+}
diff --git a/test/unit/org/apache/cassandra/cql3/ViewPKTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewPKTest.java
new file mode 100644
index 000..06664cb
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/ViewPKTest.java
@@ -0,0 +1,461 @@
+/*

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-07-05 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit f74f5d001ef0f3cd502dca6111c018fca3ca12b5
Merge: cc3d59a ba0f622
Author: Bereng 
AuthorDate: Mon Jul 5 11:11:38 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../apache/cassandra/cql3/ViewAbstractTest.java| 108 +++
 .../unit/org/apache/cassandra/cql3/ViewPKTest.java | 461 +++
 .../org/apache/cassandra/cql3/ViewRangesTest.java  | 197 +
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 917 +
 .../org/apache/cassandra/cql3/ViewTimesTest.java   | 300 +++
 5 files changed, 1076 insertions(+), 907 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0.0 updated (d13bef9 -> 6d16a53)

2021-07-05 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from d13bef9  Increment version to 4.0-rc3
 new 6d16a53  Flaky ViewTest patch by Berenguer Blasi; reviewed by Andres 
de la Peña for CASSANDRA-16777

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/cql3/ViewAbstractTest.java| 108 +++
 .../unit/org/apache/cassandra/cql3/ViewPKTest.java | 461 +++
 .../org/apache/cassandra/cql3/ViewRangesTest.java  | 197 +
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 917 +
 .../org/apache/cassandra/cql3/ViewTimesTest.java   | 300 +++
 5 files changed, 1076 insertions(+), 907 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewAbstractTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewPKTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewRangesTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (cc3d59a -> f74f5d0)

2021-07-05 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from cc3d59a  Merge branch 'cassandra-4.0' into trunk
 new 6d16a53  Flaky ViewTest patch by Berenguer Blasi; reviewed by Andres 
de la Peña for CASSANDRA-16777
 new ba0f622  Merge branch 'cassandra-4.0.0' into cassandra-4.0
 new f74f5d0  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/cql3/ViewAbstractTest.java| 108 +++
 .../unit/org/apache/cassandra/cql3/ViewPKTest.java | 461 +++
 .../org/apache/cassandra/cql3/ViewRangesTest.java  | 197 +
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 917 +
 .../org/apache/cassandra/cql3/ViewTimesTest.java   | 300 +++
 5 files changed, 1076 insertions(+), 907 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewAbstractTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewPKTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewRangesTest.java
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0.0 updated (4c98576 -> cfefdfd)

2021-06-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 4c98576  Prepare debian changelog for 4.0-rc2
 new cfefdfd  Flaky MessageFiltersTest patch by Berenguer Blasi; reviewed 
by Brandon Williams, Ekaterina Dimitrova for CASSANDRA-16771

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/distributed/test/MessageFiltersTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (4c4e84f -> 7f691b8)

2021-06-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 4c4e84f  Merge branch 'cassandra-4.0' into trunk
 new cfefdfd  Flaky MessageFiltersTest patch by Berenguer Blasi; reviewed 
by Brandon Williams, Ekaterina Dimitrova for CASSANDRA-16771
 new 752213c  Merge branch 'cassandra-4.0.0' into cassandra-4.0
 new 7f691b8  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/distributed/test/MessageFiltersTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Flaky MessageFiltersTest patch by Berenguer Blasi; reviewed by Brandon Williams, Ekaterina Dimitrova for CASSANDRA-16771

2021-06-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new cfefdfd  Flaky MessageFiltersTest patch by Berenguer Blasi; reviewed 
by Brandon Williams, Ekaterina Dimitrova for CASSANDRA-16771
 new 752213c  Merge branch 'cassandra-4.0.0' into cassandra-4.0
cfefdfd is described below

commit cfefdfd76e4ac35ee748132013718e7196b04742
Author: Bereng 
AuthorDate: Tue Jun 29 07:01:17 2021 +0200

Flaky MessageFiltersTest
patch by Berenguer Blasi; reviewed by Brandon Williams, Ekaterina Dimitrova 
for CASSANDRA-16771
---
 .../org/apache/cassandra/distributed/test/MessageFiltersTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
 
b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
index 44f70e4..6ea186c 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
@@ -187,7 +187,7 @@ public class MessageFiltersTest extends TestBaseImpl
 String read = "SELECT * FROM " + KEYSPACE + ".tbl";
 String write = "INSERT INTO " + KEYSPACE + ".tbl (pk, ck, v) VALUES 
(1, 1, 1)";
 
-try (ICluster cluster = 
builder().withNodes(2).start())
+try (ICluster cluster = 
builder().withNodes(2).withConfig(c -> c.set("range_request_timeout_in_ms", 
2)).start())
 {
 cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': " + 
cluster.size() + "};");
 cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, 
ck int, v int, PRIMARY KEY (pk, ck))");

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-06-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 7f691b814d4df985af9c0d768634032173ccf60e
Merge: 4c4e84f 752213c
Author: Bereng 
AuthorDate: Wed Jun 30 09:36:20 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/distributed/test/MessageFiltersTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated: Fix How-to Commit docs

2021-04-26 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
 new e74d891  Fix How-to Commit docs
e74d891 is described below

commit e74d89114d7d24a17a51bda60a3ac8ad24627058
Author: Bereng 
AuthorDate: Thu Apr 22 09:38:38 2021 +0200

Fix How-to Commit docs

patch by Berenguer Blasi; reviewed by Mick Semb Wever, Ekaterina Dimitrova 
for CASSANDRA-16626
---
 doc/source/development/how_to_commit.rst | 49 +---
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/doc/source/development/how_to_commit.rst 
b/doc/source/development/how_to_commit.rst
index 528ac40..148f3f0 100644
--- a/doc/source/development/how_to_commit.rst
+++ b/doc/source/development/how_to_commit.rst
@@ -23,26 +23,26 @@ If you are a committer, feel free to pick any process that 
works for you - so lo
 
 Here is how committing and merging will usually look for merging and pushing 
for tickets that follow the convention (if patch-based):
 
-Hypothetical CASSANDRA-12345 ticket is a cassandra-3.0 based bug fix that 
requires different code for cassandra-3.3, and trunk. Contributor Jackie 
supplied a patch for the root branch (12345-3.0.patch), and patches for the 
remaining branches (12345-3.3.patch, 12345-trunk.patch).
+Hypothetical CASSANDRA-12345 ticket is a cassandra-3.0 based bug fix that 
requires different code for cassandra-3.11, and trunk. Contributor Jackie 
supplied a patch for the root branch (12345-3.0.patch), and patches for the 
remaining branches (12345-3.11.patch, 12345-trunk.patch).
 
 On cassandra-3.0:
#. ``git am -3 12345-3.0.patch`` (if we have a problem b/c of CHANGES.txt 
not merging anymore, we fix  it ourselves, in place)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
 
-On cassandra-3.3:
+On cassandra-3.11:
#. ``git merge cassandra-3.0 -s ours``
-   #. ``git apply -3 12345-3.3.patch`` (likely to have an issue with 
CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
+   #. ``git apply -3 12345-3.11.patch`` (likely to have an issue with 
CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
-   #. ``git commit --amend``
+   #. ``git commit --amend`` (Notice this will squash the 3.11 applied patch 
into the forward merge commit)
 
 On trunk:
-   #. ``git merge cassandra-3.3 -s ours``
+   #. ``git merge cassandra-3.11 -s ours``
#. ``git apply -3 12345-trunk.patch`` (likely to have an issue with 
CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
-   #. ``git commit --amend``
+   #. ``git commit --amend`` (Notice this will squash the trunk applied patch 
into the forward merge commit)
 
 On any branch:
-   #. ``git push origin cassandra-3.0 cassandra-3.3 trunk --atomic``
+   #. ``git push origin cassandra-3.0 cassandra-3.11 trunk --atomic``
 
 Same scenario, but a branch-based contribution:
 
@@ -50,22 +50,22 @@ On cassandra-3.0:
#. ``git cherry-pick `` (if we have a problem b/c of 
CHANGES.txt not merging anymore, we fix it ourselves, in place)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
 
-On cassandra-3.3:
+On cassandra-3.11:
#. ``git merge cassandra-3.0 -s ours``
-   #. ``git format-patch -1 ``
-   #. ``git apply -3 .patch`` (likely to have an issue with 
CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
+   #. ``git format-patch -1 ``
+   #. ``git apply -3 .patch`` (likely to have an issue 
with CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
-   #. ``git commit --amend``
+   #. ``git commit --amend`` (Notice this will squash the 3.11 applied patch 
into the forward merge commit)
 
 On trunk:
-   #. ``git merge cassandra-3.3 -s ours``
+   #. ``git merge cassandra-3.11 -s ours``
#. ``git format-patch -1 ``
#. ``git apply -3 .patch`` (likely to have an issue 
with CHANGES.txt here: fix it ourselves, then git add CHANGES.txt)
#. ``ant realclean && ant jar build-test`` (rebuild to make sure code 
compiles)
-   #. ``git commit --amend``
+   #. ``git commit --amend`` (Notice this will squash the trunk applied patch 
into the forward merge commit)
 
 On any branch:
-   #. ``git push origin cassandra-3.0 cassandra-3.3 trunk --atomic``
+   #. ``git push origin cassandra-3.0 cassandra-3.11 trunk --atomic``
 
 If the patch is for an older branch, and doesn't impact later branches (such 
as trunk), we still need to merge up.
 
@@ -73,16 +73,31 @@ On cassandra-3.0:
#. ``git cherry-pick `` (if we have a problem b/c of 
CHANGES.txt no

[cassandra] branch cassandra-4.0 updated: Increase timeout for ConnectionBurnTest

2021-05-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new b69297e  Increase timeout for ConnectionBurnTest
b69297e is described below

commit b69297ebb28dc8b4e110c2d9785a04f91acb5558
Author: Bereng 
AuthorDate: Mon May 3 09:47:27 2021 +0200

Increase timeout for ConnectionBurnTest

patch by Berenguer Blasi; reviewed by Brandom Williams for CASSANDRA-16650
---
 test/burn/org/apache/cassandra/net/ConnectionBurnTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/burn/org/apache/cassandra/net/ConnectionBurnTest.java 
b/test/burn/org/apache/cassandra/net/ConnectionBurnTest.java
index dea552c..eba8b65 100644
--- a/test/burn/org/apache/cassandra/net/ConnectionBurnTest.java
+++ b/test/burn/org/apache/cassandra/net/ConnectionBurnTest.java
@@ -473,7 +473,7 @@ public class ConnectionBurnTest
 }
 
 executor.shutdownNow();
-ExecutorUtils.awaitTermination(1L, TimeUnit.MINUTES, executor);
+ExecutorUtils.awaitTermination(5L, TimeUnit.MINUTES, executor);
 }
 finally
 {

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (5bd8207 -> 48570e9)

2021-05-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 5bd8207  Fix flaky test testHasVersion3Nodes - 
org.apache.cassandra.gms.GossiperTest
 new b69297e  Increase timeout for ConnectionBurnTest
 new 48570e9  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 test/burn/org/apache/cassandra/net/ConnectionBurnTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-05-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 48570e91b1f328650b2c791b09a22367ee0a86cf
Merge: 5bd8207 b69297e
Author: Bereng 
AuthorDate: Tue May 4 09:44:27 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 test/burn/org/apache/cassandra/net/ConnectionBurnTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated: CASSANDRA-16532 Fix flaky testSkipScrubCorruptedCounterRowWithTool

2021-04-06 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 6115a02  CASSANDRA-16532 Fix flaky 
testSkipScrubCorruptedCounterRowWithTool
6115a02 is described below

commit 6115a02021c86028c0cc5a510452454cc8b4d2c2
Author: Bereng 
AuthorDate: Tue Mar 23 09:24:04 2021 +0100

CASSANDRA-16532 Fix flaky testSkipScrubCorruptedCounterRowWithTool

patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16532
---
 test/unit/org/apache/cassandra/db/ScrubTest.java | 256 ---
 1 file changed, 139 insertions(+), 117 deletions(-)

diff --git a/test/unit/org/apache/cassandra/db/ScrubTest.java 
b/test/unit/org/apache/cassandra/db/ScrubTest.java
index 343089e..1b42505 100644
--- a/test/unit/org/apache/cassandra/db/ScrubTest.java
+++ b/test/unit/org/apache/cassandra/db/ScrubTest.java
@@ -34,10 +34,12 @@ import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.commons.lang3.StringUtils;
 
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -105,12 +107,7 @@ public class ScrubTest
 {
 public static final String INVALID_LEGACY_SSTABLE_ROOT_PROP = 
"invalid-legacy-sstable-root";
 
-public static final String KEYSPACE = "Keyspace1";
-public static final String KEYSPACE2 = "Keyspace2";
 public static final String CF = "Standard1";
-public static final String CF2 = "Standard2";
-public static final String CF3 = "Standard3";
-public static final String CF4 = "Standard4";
 public static final String COUNTER_CF = "Counter1";
 public static final String CF_UUID = "UUIDKeys";
 public static final String CF_INDEX1 = "Indexed1";
@@ -122,21 +119,34 @@ public class ScrubTest
 
 public static final Integer COMPRESSION_CHUNK_LENGTH = 4096;
 
+private static final AtomicInteger seq = new AtomicInteger();
+
+private String ksName;
+private Keyspace keyspace;
+
 @BeforeClass
 public static void defineSchema() throws ConfigurationException
 {
 loadSchema();
-createKeyspace(KEYSPACE,
+}
+
+@Before
+public void setup()
+{
+ksName = "scrub_test_" + seq.incrementAndGet();
+createKeyspace(ksName,
KeyspaceParams.simple(1),
-   standardCFMD(KEYSPACE, CF),
-   standardCFMD(KEYSPACE, CF2),
-   standardCFMD(KEYSPACE, CF3),
-   counterCFMD(KEYSPACE, 
COUNTER_CF).compression(getCompressionParameters(COMPRESSION_CHUNK_LENGTH)),
-   standardCFMD(KEYSPACE, CF_UUID, 0, UUIDType.instance),
-   SchemaLoader.keysIndexCFMD(KEYSPACE, CF_INDEX1, true),
-   SchemaLoader.compositeIndexCFMD(KEYSPACE, CF_INDEX2, 
true),
-   SchemaLoader.keysIndexCFMD(KEYSPACE, 
CF_INDEX1_BYTEORDERED, true).partitioner(ByteOrderedPartitioner.instance),
-   SchemaLoader.compositeIndexCFMD(KEYSPACE, 
CF_INDEX2_BYTEORDERED, true).partitioner(ByteOrderedPartitioner.instance));
+   standardCFMD(ksName, CF),
+   counterCFMD(ksName, 
COUNTER_CF).compression(getCompressionParameters(COMPRESSION_CHUNK_LENGTH)),
+   standardCFMD(ksName, CF_UUID, 0, UUIDType.instance),
+   SchemaLoader.keysIndexCFMD(ksName, CF_INDEX1, true),
+   SchemaLoader.compositeIndexCFMD(ksName, CF_INDEX2, 
true),
+   SchemaLoader.keysIndexCFMD(ksName, 
CF_INDEX1_BYTEORDERED, true).partitioner(ByteOrderedPartitioner.instance),
+   SchemaLoader.compositeIndexCFMD(ksName, 
CF_INDEX2_BYTEORDERED, true).partitioner(ByteOrderedPartitioner.instance));
+keyspace = Keyspace.open(ksName);
+
+CompactionManager.instance.disableAutoCompaction();
+
System.setProperty(org.apache.cassandra.tools.Util.ALLOW_TOOL_REINIT_FOR_TEST, 
"true"); // Necessary for testing
 }
 
 @AfterClass
@@ -149,9 +159,7 @@ public class ScrubTest
 public void testScrubOneRow() throws ExecutionException, 
InterruptedException
 {
 CompactionManager.instance.disableAutoCompaction();
-Keyspace keyspace = Keyspace.open(KEYSPACE);
 ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
-cfs.clearUnsafe();
 
 // insert data and verify we get it back w/ range query
 fillCF(cfs, 1);
@@ -171,9 +179,7 @@ public class ScrubTest
 int numPartitions = 

[cassandra] branch trunk updated: Flaky StorageServiceServerTest

2021-04-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 44f5b8a  Flaky StorageServiceServerTest
44f5b8a is described below

commit 44f5b8adf53f31c793a35387004f26f87c8b936d
Author: Bereng 
AuthorDate: Fri Apr 9 09:55:27 2021 +0200

Flaky StorageServiceServerTest

patch by Berenguer Blasi; reviewed by Michael Semb Wever for CASSANDRA-16569
---
 .../service/StorageServiceServerTest.java  | 244 +++--
 1 file changed, 123 insertions(+), 121 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java 
b/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
index 55286ec..c0071b4 100644
--- a/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
+++ b/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
@@ -55,6 +55,7 @@ import org.apache.cassandra.locator.PropertyFileSnitch;
 import org.apache.cassandra.locator.TokenMetadata;
 import org.apache.cassandra.schema.*;
 import org.apache.cassandra.utils.FBUtilities;
+import org.assertj.core.api.Assertions;
 
 import static org.apache.cassandra.ServerTestUtils.cleanup;
 import static org.apache.cassandra.ServerTestUtils.mkdirs;
@@ -147,7 +148,7 @@ public class StorageServiceServerTest
 for (int i = 0; i < 5; i++)
 WindowsFailedSnapshotTracker.handleFailedSnapshot(new File(f, 
Integer.toString(i)));
 
-assert new File(WindowsFailedSnapshotTracker.TODELETEFILE).exists();
+assertTrue(new 
File(WindowsFailedSnapshotTracker.TODELETEFILE).exists());
 
 // Simulate shutdown and restart of C* node, closing out the list of 
failed snapshots.
 WindowsFailedSnapshotTracker.resetForTests();
@@ -170,8 +171,8 @@ public class StorageServiceServerTest
 WindowsFailedSnapshotTracker.handleFailedSnapshot(protectedDir);
 WindowsFailedSnapshotTracker.deleteOldSnapshots();
 
-assert protectedDir.exists();
-assert protectedFile.exists();
+assertTrue(protectedDir.exists());
+assertTrue(protectedFile.exists());
 
 protectedFile.delete();
 protectedDir.delete();
@@ -190,6 +191,7 @@ public class StorageServiceServerTest
 // no need to insert extra data, even an "empty" database will have a 
little information in the system keyspace
 StorageService.instance.takeSnapshot(UUID.randomUUID().toString(), 
SchemaConstants.SCHEMA_KEYSPACE_NAME);
 }
+
 @Test
 public void testLocalPrimaryRangeForEndpointWithNetworkTopologyStrategy() 
throws Exception
 {
@@ -214,20 +216,20 @@ public class StorageServiceServerTest
 Schema.instance.load(meta);
 
 Collection> primaryRanges = 
StorageService.instance.getLocalPrimaryRangeForEndpoint(InetAddressAndPort.getByName("127.0.0.1"));
-assertEquals(1, primaryRanges.size());
-assertTrue(primaryRanges.contains(new Range(new 
StringToken("C"), new StringToken("A";
+
Assertions.assertThat(primaryRanges.size()).as(primaryRanges.toString()).isEqualTo(1);
+Assertions.assertThat(primaryRanges).contains(new Range(new 
StringToken("C"), new StringToken("A")));
 
 primaryRanges = 
StorageService.instance.getLocalPrimaryRangeForEndpoint(InetAddressAndPort.getByName("127.0.0.2"));
-assertEquals(1, primaryRanges.size());
-assertTrue(primaryRanges.contains(new Range(new 
StringToken("A"), new StringToken("C";
+
Assertions.assertThat(primaryRanges.size()).as(primaryRanges.toString()).isEqualTo(1);
+Assertions.assertThat(primaryRanges).contains(new Range(new 
StringToken("A"), new StringToken("C")));
 
 primaryRanges = 
StorageService.instance.getLocalPrimaryRangeForEndpoint(InetAddressAndPort.getByName("127.0.0.4"));
-assertEquals(1, primaryRanges.size());
-assertTrue(primaryRanges.contains(new Range(new 
StringToken("D"), new StringToken("B";
+
Assertions.assertThat(primaryRanges.size()).as(primaryRanges.toString()).isEqualTo(1);
+Assertions.assertThat(primaryRanges).contains(new Range(new 
StringToken("D"), new StringToken("B")));
 
 primaryRanges = 
StorageService.instance.getLocalPrimaryRangeForEndpoint(InetAddressAndPort.getByName("127.0.0.5"));
-assertEquals(1, primaryRanges.size());
-assertTrue(primaryRanges.contains(new Range(new 
StringToken("B"), new StringToken("D";
+
Assertions.assertThat(primaryRanges.size()).as(primaryRanges.toString()).isEqualTo(1);
+Assertions.assertThat(primaryRanges).contains(new Range(new 
StringToken("B"

[cassandra] 02/02: CASSANDRA-16601 Flaky CassandraIndexTest

2021-04-22 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit b2e897f6a92b931f6f8595a2c0c8d12b04aaf601
Author: Bereng 
AuthorDate: Wed Apr 14 11:15:25 2021 +0200

CASSANDRA-16601 Flaky CassandraIndexTest

patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16601
---
 .../index/internal/CassandraIndexTest.java | 25 +++---
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java 
b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
index 687c631..2c46bdb 100644
--- a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.cassandra.index.internal;
 
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
@@ -42,6 +43,7 @@ import org.apache.cassandra.schema.SchemaConstants;
 import org.apache.cassandra.schema.TableMetadata;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
+import org.awaitility.Awaitility;
 
 import static org.apache.cassandra.Util.throwAssert;
 import static org.junit.Assert.assertArrayEquals;
@@ -561,33 +563,32 @@ public class CassandraIndexTest extends CQLTester
 String selectBuiltIndexesQuery = String.format("SELECT * FROM 
%s.\"%s\"",

SchemaConstants.SYSTEM_KEYSPACE_NAME,

SystemKeyspace.BUILT_INDEXES);
-UntypedResultSet rs = execute(selectBuiltIndexesQuery);
-int initialSize = rs.size();
+
+// Wait for any background index clearing tasks to complete. Warn: 
When we used to run tests in parallel there
+// could also be cross test class talk and have other indices pop up 
here.
+Awaitility.await()
+  .atMost(1, TimeUnit.MINUTES)
+  .pollDelay(1, TimeUnit.SECONDS)
+  .untilAsserted(() -> 
assertRows(execute(selectBuiltIndexesQuery)));
 
 String indexName = "build_remove_test_idx";
 String tableName = createTable("CREATE TABLE %s (a int, b int, c int, 
PRIMARY KEY (a, b))");
 createIndex(String.format("CREATE INDEX %s ON %%s(c)", indexName));
 waitForIndex(KEYSPACE, tableName, indexName);
+
 // check that there are no other rows in the built indexes table
-rs = execute(selectBuiltIndexesQuery);
-int sizeAfterBuild = rs.size();
-assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName, null));
+assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName, 
null));
 
 // rebuild the index and verify the built status table
 getCurrentColumnFamilyStore().rebuildSecondaryIndex(indexName);
 waitForIndex(KEYSPACE, tableName, indexName);
 
 // check that there are no other rows in the built indexes table
-rs = execute(selectBuiltIndexesQuery);
-assertEquals(sizeAfterBuild, rs.size());
-assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName, null));
+assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName, 
null));
 
 // check that dropping the index removes it from the built indexes 
table
 dropIndex("DROP INDEX %s." + indexName);
-rs = execute(selectBuiltIndexesQuery);
-assertEquals(initialSize, rs.size());
-rs.forEach(row -> 
assertFalse(row.getString("table_name").equals(KEYSPACE)  // table_name is 
actually keyspace
-  && 
row.getString("index_name").equals(indexName)));
+assertRows(execute(selectBuiltIndexesQuery));
 }
 
 

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (6564fe3 -> b2e897f)

2021-04-22 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 6564fe3  Merge branch 'cassandra-3.11' into trunk
 new 4bfe687  Flaky CassandraIndexTest
 new d273ecf  Merge branch 'cassandra-3.11' into trunk
 new b2e897f  CASSANDRA-16601 Flaky CassandraIndexTest

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../index/internal/CassandraIndexTest.java | 25 +++---
 1 file changed, 13 insertions(+), 12 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated: Flaky CassandraIndexTest

2021-04-22 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 4bfe687  Flaky CassandraIndexTest
4bfe687 is described below

commit 4bfe68717d9a419ab6a0b3a681478b39117dee80
Author: Bereng 
AuthorDate: Wed Apr 21 08:39:15 2021 +0200

Flaky CassandraIndexTest

patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16601
---
 .../index/internal/CassandraIndexTest.java | 31 +-
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java 
b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
index a5c1f60..4ad93b4 100644
--- a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
@@ -18,7 +18,6 @@
 
 package org.apache.cassandra.index.internal;
 
-import java.nio.ByteBuffer;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
@@ -27,6 +26,7 @@ import com.google.common.base.Joiner;
 import com.google.common.collect.*;
 import org.junit.Test;
 
+import org.apache.cassandra.Util;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.config.SchemaConstants;
@@ -570,33 +570,38 @@ public class CassandraIndexTest extends CQLTester
 String selectBuiltIndexesQuery = String.format("SELECT * FROM 
%s.\"%s\"",

SchemaConstants.SYSTEM_KEYSPACE_NAME,

SystemKeyspace.BUILT_INDEXES);
-UntypedResultSet rs = execute(selectBuiltIndexesQuery);
-int initialSize = rs.size();
+
+// Wait for any background index clearing tasks to complete. Warn: 
When we used to run tests in parallel there
+// could also be cross test class talk and have other indices pop up 
here.
+Util.spinAssertEquals(0, () -> {
+try
+{
+return execute(selectBuiltIndexesQuery).size();
+}
+catch (Throwable e)
+{
+throw new AssertionError(e);
+}
+}, 60);
 
 String indexName = "build_remove_test_idx";
 String tableName = createTable("CREATE TABLE %s (a int, b int, c int, 
PRIMARY KEY (a, b))");
 createIndex(String.format("CREATE INDEX %s ON %%s(c)", indexName));
 waitForIndex(KEYSPACE, tableName, indexName);
+
 // check that there are no other rows in the built indexes table
-rs = execute(selectBuiltIndexesQuery);
-int sizeAfterBuild = rs.size();
-assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName));
+assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName));
 
 // rebuild the index and verify the built status table
 getCurrentColumnFamilyStore().rebuildSecondaryIndex(indexName);
 waitForIndex(KEYSPACE, tableName, indexName);
 
 // check that there are no other rows in the built indexes table
-rs = execute(selectBuiltIndexesQuery);
-assertEquals(sizeAfterBuild, rs.size());
-assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName));
+assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName));
 
 // check that dropping the index removes it from the built indexes 
table
 dropIndex("DROP INDEX %s." + indexName);
-rs = execute(selectBuiltIndexesQuery);
-assertEquals(initialSize, rs.size());
-rs.forEach(row -> 
assertFalse(row.getString("table_name").equals(KEYSPACE)  // table_name is 
actually keyspace
-  && 
row.getString("index_name").equals(indexName)));
+assertRows(execute(selectBuiltIndexesQuery));
 }
 
 // this is slightly annoying, but we cannot read rows from the methods in 
Util as

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/02: Merge branch 'cassandra-3.11' into trunk

2021-04-22 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit d273ecf9f2fc2387330cdc130323520d562e2fed
Merge: 6564fe3 4bfe687
Author: Bereng 
AuthorDate: Thu Apr 22 07:53:06 2021 +0200

Merge branch 'cassandra-3.11' into trunk


-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (433274b -> f80b177)

2021-08-18 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 433274b  Merge branch cassandra-3.11 into cassandra-4.0
 new 23b61a5  Prevent broken concurrent schema pulls
 new f80b177  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/java/org/apache/cassandra/schema/SchemaKeyspace.java|  4 +---
 .../org/apache/cassandra/schema/SchemaKeyspaceTest.java | 13 +
 2 files changed, 14 insertions(+), 3 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated: Prevent broken concurrent schema pulls

2021-08-18 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 23b61a5  Prevent broken concurrent schema pulls
23b61a5 is described below

commit 23b61a5fa1de17cc6b8a1d7c300053160bfc728a
Author: Bereng 
AuthorDate: Mon Aug 16 07:46:33 2021 +0200

Prevent broken concurrent schema pulls

patch by Dimitar Dimitrov and Berenguer Blasi; reviewed by Brandon 
Williams, Berenguer Blasi for CASSANDRA-16856

Co-authored-by: Dimitar Dimitrov 
Co-authored-by: Berenguer Blasi 
---
 src/java/org/apache/cassandra/schema/SchemaKeyspace.java|  2 +-
 .../org/apache/cassandra/service/MigrationCoordinator.java  |  1 +
 src/java/org/apache/cassandra/service/MigrationManager.java |  1 +
 .../org/apache/cassandra/schema/SchemaKeyspaceTest.java | 13 +
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java 
b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
index b852072..68c0b07 100644
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
@@ -380,7 +380,7 @@ public final class SchemaKeyspace
 return PartitionRangeReadCommand.allDataRead(cfs.metadata, 
FBUtilities.nowInSeconds());
 }
 
-public static Collection convertSchemaToMutations()
+public static synchronized Collection convertSchemaToMutations()
 {
 Map mutationMap = new HashMap<>();
 
diff --git a/src/java/org/apache/cassandra/service/MigrationCoordinator.java 
b/src/java/org/apache/cassandra/service/MigrationCoordinator.java
index 10c7551..ce5f269 100644
--- a/src/java/org/apache/cassandra/service/MigrationCoordinator.java
+++ b/src/java/org/apache/cassandra/service/MigrationCoordinator.java
@@ -481,6 +481,7 @@ public class MigrationCoordinator
 {
 try
 {
+logger.debug("Pulled schema from endpoint {};", 
endpoint);
 mergeSchemaFrom(endpoint, mutations);
 }
 catch (Exception e)
diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java 
b/src/java/org/apache/cassandra/service/MigrationManager.java
index 8d8a0bd..21daef2 100644
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@ -431,6 +431,7 @@ public class MigrationManager
 
 private static void pushSchemaMutation(InetAddress endpoint, 
Collection schema)
 {
+logger.debug("Pushing schema to endpoint {}", endpoint);
 MessageOut> msg = new 
MessageOut<>(MessagingService.Verb.DEFINITIONS_UPDATE,
 schema,
 
MigrationsSerializer.instance);
diff --git a/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java 
b/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
index f3ee85d..19f06e5 100644
--- a/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
@@ -19,6 +19,8 @@
 package org.apache.cassandra.schema;
 
 import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -92,6 +94,17 @@ public class SchemaKeyspaceTest
 SchemaLoader.standardCFMD(KEYSPACE1, 
CF_STANDARD1));
 }
 
+/** See CASSANDRA-16856. Make sure schema pulls are synchronized to 
prevent concurrent schema pull/writes
+ *
+ * @throws Exception
+ */
+@Test
+public void testSchemaPullSynchoricity() throws Exception
+{
+Method method = 
SchemaKeyspace.class.getDeclaredMethod("convertSchemaToMutations");
+assertTrue(Modifier.isSynchronized(method.getModifiers()));
+}
+
 @Test
 public void testThriftConversion() throws Exception
 {

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-08-18 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit f80b177f6f615724c445ed16d2b0cb7b48461375
Merge: 433274b 23b61a5
Author: Bereng 
AuthorDate: Thu Aug 19 07:36:07 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 src/java/org/apache/cassandra/schema/SchemaKeyspace.java|  4 +---
 .../org/apache/cassandra/schema/SchemaKeyspaceTest.java | 13 +
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --cc src/java/org/apache/cassandra/schema/SchemaKeyspace.java
index 65e9adb,68c0b07..e8c22b1
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
@@@ -39,12 -41,10 +39,11 @@@ import org.apache.cassandra.db.filter.C
  import org.apache.cassandra.db.marshal.*;
  import org.apache.cassandra.db.partitions.*;
  import org.apache.cassandra.db.rows.*;
 -import org.apache.cassandra.db.filter.ColumnFilter;
 -import org.apache.cassandra.db.view.View;
 -import org.apache.cassandra.exceptions.ConfigurationException;
  import org.apache.cassandra.exceptions.InvalidRequestException;
- import org.apache.cassandra.exceptions.StartupException;
 +import org.apache.cassandra.service.reads.SpeculativeRetryPolicy;
 +import org.apache.cassandra.schema.ColumnMetadata.ClusteringOrder;
 +import org.apache.cassandra.schema.Keyspaces.KeyspacesDiff;
 +import org.apache.cassandra.service.reads.repair.ReadRepairStrategy;
  import org.apache.cassandra.transport.ProtocolVersion;
  import org.apache.cassandra.utils.ByteBufferUtil;
  import org.apache.cassandra.utils.FBUtilities;
@@@ -52,11 -53,9 +51,10 @@@
  import static java.lang.String.format;
  
  import static java.util.stream.Collectors.toList;
 +import static java.util.stream.Collectors.toSet;
 +
- import static org.apache.cassandra.cql3.ColumnIdentifier.maybeQuote;
  import static org.apache.cassandra.cql3.QueryProcessor.executeInternal;
  import static org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal;
 -import static org.apache.cassandra.schema.CQLTypeParser.parse;
  
  /**
   * system_schema.* tables and methods for manipulating them.
@@@ -390,12 -377,12 +388,12 @@@ public final class SchemaKeyspac
  private static ReadCommand getReadCommandForTableSchema(String 
schemaTableName)
  {
  ColumnFamilyStore cfs = getSchemaCFS(schemaTableName);
 -return PartitionRangeReadCommand.allDataRead(cfs.metadata, 
FBUtilities.nowInSeconds());
 +return PartitionRangeReadCommand.allDataRead(cfs.metadata(), 
FBUtilities.nowInSeconds());
  }
  
- static Collection convertSchemaToMutations()
 -public static synchronized Collection convertSchemaToMutations()
++static synchronized Collection convertSchemaToMutations()
  {
 -Map mutationMap = new HashMap<>();
 +Map mutationMap = 
new HashMap<>();
  
  for (String table : ALL)
  convertSchemaToMutations(mutationMap, table);
diff --cc test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
index bf62203,19f06e5..c0c56aa
--- a/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
@@@ -19,10 -19,16 +19,12 @@@
  package org.apache.cassandra.schema;
  
  import java.io.IOException;
+ import java.lang.reflect.Method;
+ import java.lang.reflect.Modifier;
  import java.nio.ByteBuffer;
 -import java.util.ArrayList;
 -import java.util.Collection;
  import java.util.Collections;
  import java.util.HashSet;
 -import java.util.List;
  import java.util.Set;
 -import java.util.UUID;
  
  import com.google.common.collect.ImmutableMap;
  
@@@ -61,7 -94,55 +63,18 @@@ public class SchemaKeyspaceTes
  SchemaLoader.standardCFMD(KEYSPACE1, 
CF_STANDARD1));
  }
  
+ /** See CASSANDRA-16856. Make sure schema pulls are synchronized to 
prevent concurrent schema pull/writes
+  *
+  * @throws Exception
+  */
+ @Test
+ public void testSchemaPullSynchoricity() throws Exception
+ {
+ Method method = 
SchemaKeyspace.class.getDeclaredMethod("convertSchemaToMutations");
+ assertTrue(Modifier.isSynchronized(method.getModifiers()));
+ }
+ 
  @Test
 -public void testThriftConversion() throws Exception
 -{
 -CfDef cfDef = new 
CfDef().setDefault_validation_class(AsciiType.class.getCanonicalName())
 - .setComment("Test comment")
 - .setColumn_metadata(columnDefs)
 - .setKeyspace(KEYSPACE1)
 - .setName(CF_STANDARD1);
 -
 -// convert Thrift to CFMetaData
 -CFMetaData cfMetaData = ThriftConversion.fromThrift(cfDef);
 -
 -CfDef thriftCfDef = new CfDef();
 -thriftCfDef.keyspace = KEYSP

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-08-18 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 058182025931e6b508d70fa9cfd294c7c860b185
Merge: 304deea f80b177
Author: Bereng 
AuthorDate: Thu Aug 19 07:38:41 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 src/java/org/apache/cassandra/schema/SchemaKeyspace.java|  4 +---
 .../org/apache/cassandra/schema/SchemaKeyspaceTest.java | 13 +
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --cc test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
index bf62203,c0c56aa..44fb2c0
--- a/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
+++ b/test/unit/org/apache/cassandra/schema/SchemaKeyspaceTest.java
@@@ -61,6 -63,17 +63,17 @@@ public class SchemaKeyspaceTes
  SchemaLoader.standardCFMD(KEYSPACE1, 
CF_STANDARD1));
  }
  
+ /** See CASSANDRA-16856. Make sure schema pulls are synchronized to 
prevent concurrent schema pull/writes
 - *
 - * @throws Exception
 - */
 -@Test
 -public void testSchemaPullSynchoricity() throws Exception
 -{
 -Method method = 
SchemaKeyspace.class.getDeclaredMethod("convertSchemaToMutations");
 -assertTrue(Modifier.isSynchronized(method.getModifiers()));
 -}
++*
++* @throws Exception
++*/
++   @Test
++   public void testSchemaPullSynchoricity() throws Exception
++   {
++   Method method = 
SchemaKeyspace.class.getDeclaredMethod("convertSchemaToMutations");
++   assertTrue(Modifier.isSynchronized(method.getModifiers()));
++   }
+ 
  @Test
  public void testConversionsInverses() throws Exception
  {

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (304deea -> 0581820)

2021-08-18 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 304deea  Merge branch cassandra-4.0 into trunk
 new 23b61a5  Prevent broken concurrent schema pulls
 new f80b177  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 0581820  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/java/org/apache/cassandra/schema/SchemaKeyspace.java|  4 +---
 .../org/apache/cassandra/schema/SchemaKeyspaceTest.java | 13 +
 2 files changed, 14 insertions(+), 3 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (39af4a5 -> 913d541)

2021-08-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 39af4a5  Merge branch 'cassandra-4.0' into trunk
 new 99e1fcc  Materialized views incorrect quoting of UDF
 new f242ccb  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 913d541  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/functions/FunctionCall.java |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 132 +
 2 files changed, 135 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated: Materialized views incorrect quoting of UDF

2021-08-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 99e1fcc  Materialized views incorrect quoting of UDF
99e1fcc is described below

commit 99e1fcc251bd498abab17a59a9fc9593d242671b
Author: Bereng 
AuthorDate: Wed Aug 11 08:43:07 2021 +0200

Materialized views incorrect quoting of UDF

patch by Andres de la Peña, Jakub Zytka, Berenguer Blasi; reviewed by 
Andres de la Peña, Jakub Zytka for CASSANDRA-16836

Co-authored-by: Andres de la Peña 
Co-authored-by: Jakub Zytka 
Co-authored-by: Berenguer Blasi 
---
 .../cassandra/cql3/functions/FunctionCall.java |   2 +-
 .../cassandra/cql3/functions/FunctionName.java |  18 +++
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 122 -
 3 files changed, 140 insertions(+), 2 deletions(-)

diff --git a/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java 
b/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
index 8dcb3da..c0d616e 100644
--- a/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
@@ -204,7 +204,7 @@ public class FunctionCall extends Term.NonTerminal
 
 public String getText()
 {
-return name + 
terms.stream().map(Term.Raw::getText).collect(Collectors.joining(", ", "(", 
")"));
+return name.toCQLString() + 
terms.stream().map(Term.Raw::getText).collect(Collectors.joining(", ", "(", 
")"));
 }
 }
 }
diff --git a/src/java/org/apache/cassandra/cql3/functions/FunctionName.java 
b/src/java/org/apache/cassandra/cql3/functions/FunctionName.java
index aa980e9..efa7adf 100644
--- a/src/java/org/apache/cassandra/cql3/functions/FunctionName.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FunctionName.java
@@ -20,9 +20,13 @@ package org.apache.cassandra.cql3.functions;
 import com.google.common.base.Objects;
 
 import org.apache.cassandra.config.SchemaConstants;
+import org.apache.cassandra.cql3.ColumnIdentifier;
 
 public final class FunctionName
 {
+// We special case the token function because that's the only function 
which name is a reserved keyword
+private static final FunctionName TOKEN_FUNCTION_NAME = 
FunctionName.nativeFunction("token");
+
 public final String keyspace;
 public final String name;
 
@@ -79,4 +83,18 @@ public final class FunctionName
 {
 return keyspace == null ? name : keyspace + "." + name;
 }
+
+/**
+ * Returns a string representation of the function name that is safe to 
use directly in CQL queries.
+ * If necessary, the name components will be double-quoted, and any quotes 
inside the names will be escaped.
+ */
+public String toCQLString()
+{
+String maybeQuotedName = equalsNativeFunction(TOKEN_FUNCTION_NAME)
+   ? name
+   : ColumnIdentifier.maybeQuote(name);
+return keyspace == null
+   ? maybeQuotedName
+   : ColumnIdentifier.maybeQuote(keyspace) + '.' + maybeQuotedName;
+}
 }
diff --git a/test/unit/org/apache/cassandra/cql3/ViewTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewTest.java
index 38b1a35..07a518b 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewTest.java
@@ -24,6 +24,8 @@ import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import com.google.common.util.concurrent.Uninterruptibles;
 
 import junit.framework.Assert;
@@ -44,6 +46,7 @@ import org.apache.cassandra.concurrent.StageManager;
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.config.SchemaConstants;
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.SystemKeyspace;
@@ -52,6 +55,7 @@ import org.apache.cassandra.db.marshal.AsciiType;
 import org.apache.cassandra.db.view.View;
 import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.schema.KeyspaceParams;
+import org.apache.cassandra.schema.SchemaKeyspace;
 import org.apache.cassandra.service.ClientWarn;
 import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.utils.FBUtilities;
@@ -71,6 +75,7 @@ public class ViewTest extends CQLTester
 /** Latch used by {@link #testTruncateWhileBuilding()} Byteman injections. 
*/
 @SuppressWarnings("unused")
 private static final CountDownLatch blockViewBuil

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-08-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 913d541ee9b9a636c02397f9fd3123e023d5c941
Merge: 39af4a5 f242ccb
Author: Bereng 
AuthorDate: Fri Aug 13 08:45:49 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../cassandra/cql3/functions/FunctionCall.java |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 132 +
 2 files changed, 135 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (979ab72 -> f242ccb)

2021-08-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 979ab72  ArrayClustering.unsharedHeapSize does not include the data so 
undercounts the heap size
 new 99e1fcc  Materialized views incorrect quoting of UDF
 new f242ccb  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/functions/FunctionCall.java |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 132 +
 2 files changed, 135 insertions(+), 1 deletion(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-08-13 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit f242ccbedd1e236b2288ea8158582eb05f623b03
Merge: 979ab72 99e1fcc
Author: Bereng 
AuthorDate: Fri Aug 13 08:42:35 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 .../cassandra/cql3/functions/FunctionCall.java |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  | 132 +
 2 files changed, 135 insertions(+), 1 deletion(-)

diff --cc src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
index e0dae52,c0d616e..0083a31
--- a/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
@@@ -227,7 -204,7 +227,9 @@@ public class FunctionCall extends Term.
  
  public String getText()
  {
- return name + 
terms.stream().map(Term.Raw::getText).collect(Collectors.joining(", ", "(", 
")"));
 -return name.toCQLString() + 
terms.stream().map(Term.Raw::getText).collect(Collectors.joining(", ", "(", 
")"));
++CqlBuilder cqlNameBuilder = new CqlBuilder();
++name.appendCqlTo(cqlNameBuilder);
++return cqlNameBuilder + 
terms.stream().map(Term.Raw::getText).collect(Collectors.joining(", ", "(", 
")"));
  }
  }
  }
diff --cc test/unit/org/apache/cassandra/cql3/ViewTest.java
index 16aa266,07a518b..a4da51a
--- a/test/unit/org/apache/cassandra/cql3/ViewTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewTest.java
@@@ -36,10 -51,14 +37,13 @@@ import org.apache.cassandra.db.ColumnFa
  import org.apache.cassandra.db.Keyspace;
  import org.apache.cassandra.db.SystemKeyspace;
  import org.apache.cassandra.db.compaction.CompactionManager;
 -import org.apache.cassandra.db.marshal.AsciiType;
  import org.apache.cassandra.db.view.View;
+ import org.apache.cassandra.exceptions.SyntaxException;
 -import org.apache.cassandra.schema.KeyspaceParams;
++import org.apache.cassandra.schema.SchemaConstants;
+ import org.apache.cassandra.schema.SchemaKeyspace;
  import org.apache.cassandra.service.ClientWarn;
 -import org.apache.cassandra.transport.ProtocolVersion;
  import org.apache.cassandra.utils.FBUtilities;
 +import org.awaitility.Awaitility;
  import org.jboss.byteman.contrib.bmunit.BMRule;
  import org.jboss.byteman.contrib.bmunit.BMRules;
  import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
@@@ -63,7 -75,49 +67,8 @@@ public class ViewTest extends ViewAbstr
  /** Latch used by {@link #testTruncateWhileBuilding()} Byteman 
injections. */
  @SuppressWarnings("unused")
  private static final CountDownLatch blockViewBuild = new 
CountDownLatch(1);
+ private static final AtomicInteger viewNameSeqNumber = new 
AtomicInteger();
  
 -private static final ProtocolVersion protocolVersion = 
ProtocolVersion.CURRENT;
 -private final List views = new ArrayList<>();
 -
 -@BeforeClass
 -public static void startup()
 -{
 -requireNetwork();
 -}
 -@Before
 -public void begin()
 -{
 -views.clear();
 -}
 -
 -@After
 -public void end() throws Throwable
 -{
 -for (String viewName : views)
 -executeNet(protocolVersion, "DROP MATERIALIZED VIEW " + viewName);
 -}
 -
 -private void createView(String name, String query) throws Throwable
 -{
 -executeNet(protocolVersion, String.format(query, name));
 -// If exception is thrown, the view will not be added to the list; 
since it shouldn't have been created, this is
 -// the desired behavior
 -views.add(name);
 -}
 -
 -private void updateView(String query, Object... params) throws Throwable
 -{
 -executeNet(protocolVersion, query, params);
 -waitForViewMutations();
 -}
 -
 -private void waitForViewMutations()
 -{
 -SEPExecutor executor = (SEPExecutor) 
StageManager.getStage(Stage.VIEW_MUTATION);
 -Util.spinAssertEquals(0L, () -> executor.getPendingTasks() + 
executor.getActiveCount(), 60);
 -}
 -
  @Test
  public void testNonExistingOnes() throws Throwable
  {
@@@ -562,20 -1491,105 +567,114 @@@
  }
  
  @Test
 -public void viewOnCompactTableTest() throws Throwable
 +public void testQuotedIdentifiersInWhereClause() throws Throwable
  {
 -createTable("CREATE TABLE %s (a int, b int, v int, PRIMARY KEY (a, 
b)) WITH COMPACT STORAGE");
 -executeNet(protocolVersion, "USE " + keyspace());
 -try
 -{
 -createView("mv",
 -   "CREATE MATERIALIZED VIEW %s AS SELECT a, b, value 
FROM %%s WHERE b IS NOT NULL PRIMARY KEY (b, a)");
 -  

[cassandra] branch trunk updated (4bb581f -> a569803)

2021-08-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 4bb581f  Merge branch 'cassandra-4.0' into trunk
 new 78c6279  Replace spinAsserts code with Awaitility code
 new a569803  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 test/unit/org/apache/cassandra/Util.java | 20 +---
 .../cassandra/metrics/ThreadPoolMetricsTest.java |  4 ++--
 2 files changed, 11 insertions(+), 13 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-08-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit a5698034c5629e46d36bbd1596b2314ef5934b51
Merge: 4bb581f 78c6279
Author: Bereng 
AuthorDate: Tue Aug 31 07:25:26 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 test/unit/org/apache/cassandra/Util.java | 20 +---
 .../cassandra/metrics/ThreadPoolMetricsTest.java |  4 ++--
 2 files changed, 11 insertions(+), 13 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Replace spinAsserts code with Awaitility code

2021-08-30 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 78c6279  Replace spinAsserts code with Awaitility code
78c6279 is described below

commit 78c6279658d5c18a8704a8e1ab1bc5200b8b1e0b
Author: Bereng 
AuthorDate: Wed Aug 18 10:49:15 2021 +0200

Replace spinAsserts code with Awaitility code

patch by Jogesh Anand, Andres de la Peña, Berenguer Blasi; reviewed by 
Andres de la Peña, Berenguer Blasi for CASSANDRA-16621

Co-authored-by: Jogesh Anand 
Co-authored-by: Andres de la Peña 
Co-authored-by: Berenguer Blasi 
---
 test/unit/org/apache/cassandra/Util.java | 20 +---
 .../cassandra/metrics/ThreadPoolMetricsTest.java |  4 ++--
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/test/unit/org/apache/cassandra/Util.java 
b/test/unit/org/apache/cassandra/Util.java
index e0d29b6..4b7b6ea 100644
--- a/test/unit/org/apache/cassandra/Util.java
+++ b/test/unit/org/apache/cassandra/Util.java
@@ -25,6 +25,7 @@ import java.io.File;
 import java.io.IOError;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
+import java.time.Duration;
 import java.util.*;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Future;
@@ -82,11 +83,14 @@ import org.apache.cassandra.utils.CassandraVersion;
 import org.apache.cassandra.utils.CounterId;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.FilterFactory;
+import org.awaitility.Awaitility;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
 
 public class Util
 {
@@ -621,17 +625,11 @@ public class Util
 
 public static  void spinAssertEquals(String message, T expected, 
Supplier actualSupplier, long timeout, TimeUnit timeUnit)
 {
-long startNano = System.nanoTime();
-long expireAtNano = startNano + timeUnit.toNanos(timeout);
-T actual = null;
-while (System.nanoTime() < expireAtNano)
-{
-actual = actualSupplier.get();
-if (actual.equals(expected))
-break;
-Thread.yield();
-}
-assertEquals(message, expected, actual);
+Awaitility.await()
+  .pollInterval(Duration.ofMillis(100))
+  .pollDelay(0, TimeUnit.MILLISECONDS)
+  .atMost(timeout, timeUnit)
+  .untilAsserted(() -> assertThat(message, 
actualSupplier.get(), equalTo(expected)));
 }
 
 public static void joinThread(Thread thread) throws InterruptedException
diff --git a/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java 
b/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java
index 03c1acf..7302655 100644
--- a/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java
+++ b/test/unit/org/apache/cassandra/metrics/ThreadPoolMetricsTest.java
@@ -159,7 +159,7 @@ public class ThreadPoolMetricsTest
 // Allowing third task to complete
 task3.allowToComplete();
 
-spinAssertEquals(true, task5::isStarted);
+spinAssertEquals(true, () -> task5.isStarted() || task6.isStarted());
 spinAssertEquals(2, metrics.activeTasks::getValue);
 spinAssertEquals(3L, metrics.completedTasks::getValue);
 spinAssertEquals(1, metrics.pendingTasks::getValue);
@@ -169,7 +169,7 @@ public class ThreadPoolMetricsTest
 // Allowing fourth task to complete
 task4.allowToComplete();
 
-spinAssertEquals(true, task6::isStarted);
+spinAssertEquals(true, () -> task5.isStarted() && task6.isStarted());
 spinAssertEquals(2, metrics.activeTasks::getValue);
 spinAssertEquals(4L, metrics.completedTasks::getValue);
 spinAssertEquals(0, metrics.pendingTasks::getValue);

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-09-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 6a4a93a808cd3c671f42bc41d0d8672e566cc5a3
Merge: b5e1386 957c626
Author: Bereng 
AuthorDate: Thu Sep 2 11:07:24 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 .../apache/cassandra/cache/NopCacheProvider.java   |  5 +++
 .../cassandra/distributed/test/NodeToolTest.java   | 11 +
 .../cassandra/cache/NopCacheProviderTest.java  | 47 ++
 3 files changed, 63 insertions(+)

diff --cc 
test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
index 7c76080,aaa7dc3..89e6168
--- a/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
@@@ -18,16 -18,10 +18,17 @@@
  
  package org.apache.cassandra.distributed.test;
  
 +import java.io.IOException;
 +import java.util.function.Consumer;
 +
 +import org.junit.AfterClass;
 +import org.junit.BeforeClass;
  import org.junit.Test;
  
 +import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.distributed.Cluster;
+ import org.apache.cassandra.distributed.api.ICluster;
 +import org.apache.cassandra.distributed.api.IInvokableInstance;
  import org.apache.cassandra.distributed.api.NodeToolResult;
  
  import static org.junit.Assert.assertEquals;
@@@ -79,30 -40,24 +80,40 @@@ public class NodeToolTest extends TestB
  }
  
  @Test
 -public void testCaptureConsoleOutput() throws Throwable
 +public void testSetGetTimeout()
  {
 -try (ICluster cluster = init(builder().withNodes(1).start()))
 +Consumer test = timeout ->
  {
 -NodeToolResult ringResult = cluster.get(1).nodetoolResult("ring");
 -ringResult.asserts().stdoutContains("Datacenter: datacenter0");
 -ringResult.asserts().stdoutContains("127.0.0.1  rack0   Up
 Normal");
 -assertEquals("Non-empty error output", "", 
ringResult.getStderr());
 -}
 +if (timeout != null)
 +NODE.nodetool("settimeout", "internodestreaminguser", 
timeout);
 +timeout = NODE.callOnInstance(() -> 
String.valueOf(DatabaseDescriptor.getInternodeStreamingTcpUserTimeoutInMS()));
 +NODE.nodetoolResult("gettimeout", "internodestreaminguser")
 +.asserts()
 +.success()
 +.stdoutContains("Current timeout for type 
internodestreaminguser: " + timeout + " ms");
 +};
 +
 +test.accept(null); // test the default value
 +test.accept("1000"); // 1 second
 +test.accept("3600"); // 10 minutes
 +}
 +
 +@Test
 +public void testSetTimeoutInvalidInput()
 +{
 +NODE.nodetoolResult("settimeout", "internodestreaminguser", "-1")
 +.asserts()
 +.failure()
 +.stdoutContains("timeout must be non-negative");
  }
+ 
+ @Test
+ public void testSetCacheCapacityWhenDisabled() throws Throwable
+ {
+ try (ICluster cluster = 
init(builder().withNodes(1).withConfig(c->c.set("row_cache_size_in_mb", 
"0")).start()))
+ {
+ NodeToolResult ringResult = 
cluster.get(1).nodetoolResult("setcachecapacity", "1", "1", "1");
+ ringResult.asserts().stderrContains("is not permitted as this 
cache is disabled");
+ }
+ }
  }
diff --cc test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java
index 000,8807883..59f6181
mode 00,100644..100644
--- a/test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java
+++ b/test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java
@@@ -1,0 -1,46 +1,47 @@@
+ /*
+  * 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
++ *   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.
++ * Unless required by app

[cassandra] branch cassandra-3.11 updated: Nodetool setcachecapacity behaves oddly when cache disabled

2021-09-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 957c626  Nodetool setcachecapacity behaves oddly when cache disabled
957c626 is described below

commit 957c6264ef97909a043a70b96cf896b1feb0f204
Author: Bereng 
AuthorDate: Thu Aug 19 11:21:58 2021 +0200

Nodetool setcachecapacity behaves oddly when cache disabled

patch by Michal Szczepanski, Berenguer Blasi; reviewed by Benjamin Lerer, 
Berenguer Blasi for CASSANDRA-#

Co-authored-by: Michal Szczepanski
Co-authored-by: Berenguer Blasi 
---
 .../apache/cassandra/cache/NopCacheProvider.java   |  5 +++
 .../cassandra/distributed/test/NodeToolTest.java   | 10 +
 .../cassandra/cache/NopCacheProviderTest.java  | 46 ++
 3 files changed, 61 insertions(+)

diff --git a/src/java/org/apache/cassandra/cache/NopCacheProvider.java 
b/src/java/org/apache/cassandra/cache/NopCacheProvider.java
index 20f837a..9b8a3dc 100644
--- a/src/java/org/apache/cassandra/cache/NopCacheProvider.java
+++ b/src/java/org/apache/cassandra/cache/NopCacheProvider.java
@@ -36,6 +36,11 @@ public class NopCacheProvider implements 
CacheProviderc.set("row_cache_size_in_mb", 
"0")).start()))
+{
+NodeToolResult ringResult = 
cluster.get(1).nodetoolResult("setcachecapacity", "1", "1", "1");
+ringResult.asserts().stderrContains("is not permitted as this 
cache is disabled");
+}
+}
 }
diff --git a/test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java 
b/test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java
new file mode 100644
index 000..8807883
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cache/NopCacheProviderTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.cache;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class NopCacheProviderTest
+{
+private ICache cache;
+
+@Before
+public void createCache()
+{
+NopCacheProvider cacheProvider = new NopCacheProvider();
+cache = cacheProvider.create();
+}
+
+@Test
+public void settingCapacityToZeroIsIgnored()
+{
+cache.setCapacity(0L);
+}
+
+@Test(expected = UnsupportedOperationException.class)
+public void failsOnSettingCapacityOtherThanZero()
+{
+cache.setCapacity(1);
+}
+}

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (b5e1386 -> 6a4a93a)

2021-09-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from b5e1386  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 957c626  Nodetool setcachecapacity behaves oddly when cache disabled
 new 6a4a93a  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/cache/NopCacheProvider.java   |  5 
 .../cassandra/distributed/test/NodeToolTest.java   | 11 
 .../NopCacheProviderTest.java} | 33 --
 3 files changed, 34 insertions(+), 15 deletions(-)
 copy test/unit/org/apache/cassandra/{utils/NativeLibraryTest.java => 
cache/NopCacheProviderTest.java} (62%)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (7d59da4 -> 2d3c21c)

2021-09-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 7d59da4  Catch read repair timeout exceptions and add metric
 new 957c626  Nodetool setcachecapacity behaves oddly when cache disabled
 new 6a4a93a  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 2d3c21c  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/cache/NopCacheProvider.java   |  5 
 .../cassandra/distributed/test/NodeToolTest.java   | 11 
 .../NopCacheProviderTest.java} | 33 --
 3 files changed, 34 insertions(+), 15 deletions(-)
 copy test/unit/org/apache/cassandra/{utils/NativeLibraryTest.java => 
cache/NopCacheProviderTest.java} (62%)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-09-02 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 2d3c21cb61097db7c33777fafc83ae93ccacf142
Merge: 7d59da4 6a4a93a
Author: Bereng 
AuthorDate: Thu Sep 2 11:09:36 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../apache/cassandra/cache/NopCacheProvider.java   |  5 +++
 .../cassandra/distributed/test/NodeToolTest.java   | 11 +
 .../cassandra/cache/NopCacheProviderTest.java  | 47 ++
 3 files changed, 63 insertions(+)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Cassandra fails to process OperationExecutionException which causes ClassCastException

2021-09-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 8b0b22e  Cassandra fails to process OperationExecutionException which 
causes ClassCastException
8b0b22e is described below

commit 8b0b22e166e2845a7c61af21cf13d8e0ff19efd6
Author: Bereng 
AuthorDate: Mon Sep 6 09:27:32 2021 +0200

Cassandra fails to process OperationExecutionException which causes 
ClassCastException

patch by Benjamin Lerer, Berenguer Blasi; reviewed by Benjamin Lerer, 
Berenguer Blasi for CASSANDRA-15269
---
 .../org/apache/cassandra/cql3/functions/FromJsonFct.java |  2 +-
 .../cassandra/exceptions/FunctionExecutionException.java | 12 +---
 .../exceptions/OperationExecutionException.java  | 16 
 .../cassandra/transport/messages/ErrorMessage.java   |  2 +-
 .../cassandra/cql3/functions/OperationFctsTest.java  | 15 +++
 5 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/src/java/org/apache/cassandra/cql3/functions/FromJsonFct.java 
b/src/java/org/apache/cassandra/cql3/functions/FromJsonFct.java
index 8f07b38..01a6e20 100644
--- a/src/java/org/apache/cassandra/cql3/functions/FromJsonFct.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FromJsonFct.java
@@ -69,7 +69,7 @@ public class FromJsonFct extends NativeScalarFunction
 }
 catch (IOException exc)
 {
-throw new FunctionExecutionException(NAME, 
Collections.singletonList("text"), String.format("Could not decode JSON string 
'%s': %s", jsonArg, exc.toString()));
+throw FunctionExecutionException.create(NAME, 
Collections.singletonList("text"), String.format("Could not decode JSON string 
'%s': %s", jsonArg, exc.toString()));
 }
 catch (MarshalException exc)
 {
diff --git 
a/src/java/org/apache/cassandra/exceptions/FunctionExecutionException.java 
b/src/java/org/apache/cassandra/exceptions/FunctionExecutionException.java
index e743fde..a9a99f6 100644
--- a/src/java/org/apache/cassandra/exceptions/FunctionExecutionException.java
+++ b/src/java/org/apache/cassandra/exceptions/FunctionExecutionException.java
@@ -37,11 +37,17 @@ public class FunctionExecutionException extends 
RequestExecutionException
 return fee;
 }
 
-public FunctionExecutionException(FunctionName functionName, List 
argTypes, String detail)
+public static FunctionExecutionException create(FunctionName functionName, 
List argTypes, String detail)
 {
-super(ExceptionCode.FUNCTION_FAILURE, "execution of '" + functionName 
+ argTypes + "' failed: " + detail);
+String msg = "execution of '" + functionName + argTypes + "' failed: " 
+ detail;
+return new FunctionExecutionException(functionName, argTypes, msg);
+}
+
+public FunctionExecutionException(FunctionName functionName, List 
argTypes, String msg)
+{
+super(ExceptionCode.FUNCTION_FAILURE, msg);
 this.functionName = functionName;
 this.argTypes = argTypes;
-this.detail = detail;
+this.detail = msg;
 }
 }
diff --git 
a/src/java/org/apache/cassandra/exceptions/OperationExecutionException.java 
b/src/java/org/apache/cassandra/exceptions/OperationExecutionException.java
index 4f9ffa4..f86969e 100644
--- a/src/java/org/apache/cassandra/exceptions/OperationExecutionException.java
+++ b/src/java/org/apache/cassandra/exceptions/OperationExecutionException.java
@@ -19,12 +19,13 @@ package org.apache.cassandra.exceptions;
 
 import java.util.List;
 
+import org.apache.cassandra.cql3.functions.OperationFcts;
 import org.apache.cassandra.db.marshal.AbstractType;
 
 /**
  * Thrown when an operation problem has occured (e.g. division by zero with 
integer).
  */
-public final class OperationExecutionException extends 
RequestExecutionException
+public final class OperationExecutionException extends 
FunctionExecutionException
 {
 
 /**
@@ -38,20 +39,19 @@ public final class OperationExecutionException extends 
RequestExecutionException
 public static OperationExecutionException create(char operator, 
List> argTypes, Exception e)
 {
 List cqlTypes = AbstractType.asCQLTypeStringList(argTypes);
-return new OperationExecutionException(String.format("the operation 
'%s %s %s' failed: %s",
- cqlTypes.get(0),
- operator,
- cqlTypes.get(1),
- e.getMessage()));
+String msg = String.format("the operation '%s %s %s' failed: %s", 
cqlTypes.get(0), operato

[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-09-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit b015cbdff6882e20fbc76dcbaf30be982e6a0195
Merge: 08444cb 8b0b22e
Author: Bereng 
AuthorDate: Fri Sep 10 09:34:21 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/cql3/functions/FromJsonFct.java |  2 +-
 .../cassandra/exceptions/FunctionExecutionException.java | 12 +---
 .../exceptions/OperationExecutionException.java  | 16 
 .../cassandra/transport/messages/ErrorMessage.java   |  2 +-
 .../cassandra/cql3/functions/OperationFctsTest.java  | 15 +++
 5 files changed, 34 insertions(+), 13 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (08444cb -> b015cbd)

2021-09-10 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 08444cb  Reduce max native frame size to 16MB
 new 8b0b22e  Cassandra fails to process OperationExecutionException which 
causes ClassCastException
 new b015cbd  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/cql3/functions/FromJsonFct.java |  2 +-
 .../cassandra/exceptions/FunctionExecutionException.java | 12 +---
 .../exceptions/OperationExecutionException.java  | 16 
 .../cassandra/transport/messages/ErrorMessage.java   |  2 +-
 .../cassandra/cql3/functions/OperationFctsTest.java  | 15 +++
 5 files changed, 34 insertions(+), 13 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-09-20 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit e60341823dee2f4ed394b5649c40fc5a1b5854c7
Merge: 7c3935c e98be8e
Author: Bereng 
AuthorDate: Mon Sep 20 09:46:52 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../cassandra/cql3/statements/schema/AlterViewStatement.java  |  5 +++--
 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java| 11 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --cc test/unit/org/apache/cassandra/cql3/ViewTimesTest.java
index 4fee422,14d7566..8d5e453
--- a/test/unit/org/apache/cassandra/cql3/ViewTimesTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewTimesTest.java
@@@ -285,12 -287,15 +287,15 @@@ public class ViewTimesTest extends View
  "c int, " +
  "val int) WITH default_time_to_live = 60");
  
 +createView("mv_ttl2", "CREATE MATERIALIZED VIEW %s AS SELECT * FROM 
%%s WHERE k IS NOT NULL AND c IS NOT NULL PRIMARY KEY (k,c)");
 +
+ execute("USE " + keyspace());
+ executeNet("USE " + keyspace());
+ 
 -createView("mv_ttl2", "CREATE MATERIALIZED VIEW %s AS SELECT * FROM 
%%s WHERE k IS NOT NULL AND c IS NOT NULL PRIMARY KEY (k,c)");
 -
  // Must NOT include "default_time_to_live" on alter Materialized View
  try
  {
- executeNet("ALTER MATERIALIZED VIEW %s WITH default_time_to_live 
= 30");
 -executeNet("ALTER MATERIALIZED VIEW " + keyspace()+ ".mv_ttl2 
WITH default_time_to_live = 30");
++executeNet("ALTER MATERIALIZED VIEW " + keyspace() + ".mv_ttl2 
WITH default_time_to_live = 30");
  Assert.fail("Should fail if TTL is provided while altering 
materialized view");
  }
  catch (Exception e)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-09-20 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit e98be8e3ec7ba68e17ce4b50a9a71b01ebefca1a
Merge: 14af149 8f4ae7d
Author: Bereng 
AuthorDate: Mon Sep 20 09:44:02 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 .../cassandra/cql3/statements/schema/AlterViewStatement.java  |  5 +++--
 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java| 11 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --cc 
src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java
index 1931bb4,000..3493eb0
mode 100644,00..100644
--- 
a/src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java
+++ 
b/src/java/org/apache/cassandra/cql3/statements/schema/AlterViewStatement.java
@@@ -1,117 -1,0 +1,118 @@@
 +/*
 + * 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.statements.schema;
 +
 +import org.apache.cassandra.audit.AuditLogContext;
 +import org.apache.cassandra.audit.AuditLogEntryType;
 +import org.apache.cassandra.auth.Permission;
 +import org.apache.cassandra.cql3.CQLStatement;
 +import org.apache.cassandra.cql3.QualifiedName;
 +import org.apache.cassandra.schema.*;
 +import org.apache.cassandra.schema.Keyspaces.KeyspacesDiff;
 +import org.apache.cassandra.service.ClientState;
 +import org.apache.cassandra.transport.Event.SchemaChange;
 +import org.apache.cassandra.transport.Event.SchemaChange.Change;
 +import org.apache.cassandra.transport.Event.SchemaChange.Target;
 +
 +public final class AlterViewStatement extends AlterSchemaStatement
 +{
 +private final String viewName;
 +private final TableAttributes attrs;
 +
 +public AlterViewStatement(String keyspaceName, String viewName, 
TableAttributes attrs)
 +{
 +super(keyspaceName);
 +this.viewName = viewName;
 +this.attrs = attrs;
 +}
 +
 +public Keyspaces apply(Keyspaces schema)
 +{
 +KeyspaceMetadata keyspace = schema.getNullable(keyspaceName);
 +
 +ViewMetadata view = null == keyspace
 +  ? null
 +  : keyspace.views.getNullable(viewName);
 +
 +if (null == view)
 +throw ire("Materialized view '%s.%s' doesn't exist", 
keyspaceName, viewName);
 +
 +attrs.validate();
 +
 +TableParams params = attrs.asAlteredTableParams(view.metadata.params);
 +
 +if (params.gcGraceSeconds == 0)
 +{
 +throw ire("Cannot alter gc_grace_seconds of a materialized view 
to 0, since this " +
 +  "value is used to TTL undelivered updates. Setting 
gc_grace_seconds too " +
 +  "low might cause undelivered updates to expire before 
being replayed.");
 +}
 +
 +if (params.defaultTimeToLive > 0)
 +{
- throw ire("Cannot set or alter default_time_to_live for a 
materialized view. " +
++throw ire("Forbidden default_time_to_live detected for a 
materialized view. " +
 +  "Data in a materialized view always expire at the same 
time than " +
-   "the corresponding data in the parent table.");
++  "the corresponding data in the parent table. 
default_time_to_live " +
++  "must be set to zero, see CASSANDRA-12868 for more 
information");
 +}
 +
 +ViewMetadata newView = view.copy(view.metadata.withSwapped(params));
 +return 
schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.views.withSwapped(newView)));
 +}
 +
 +SchemaChange schemaChangeEvent(KeyspacesDiff diff)
 +{
 +return new SchemaChange(Change.UPDATED, Target.TABLE, keyspaceName, 
viewName);
 +}
 +
 +public void authorize(ClientState client)
 +{
 +ViewMetadata view = Schema.instance.getView(keyspaceName, viewName);
 +if (null != view)
 +client.ensureTablePermission(keysp

[cassandra] branch cassandra-3.11 updated: Improve MV TTL error message

2021-09-20 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 8f4ae7d  Improve MV TTL error message
8f4ae7d is described below

commit 8f4ae7d825d90a18327c386f3cdaf414d836
Author: Bereng 
AuthorDate: Thu Sep 16 09:03:27 2021 +0200

Improve MV TTL error message

patch by Brandon Williams, Berenguer Blasi; reviewed by Brandon Williams, 
Benjamin Lerer, Aleksei Zotov for CASSANDRA-16960

Co-authored-by: Brandon Williams 
Co-authored-by: Berenguer Blasi 
---
 .../org/apache/cassandra/cql3/statements/AlterViewStatement.java | 5 +++--
 test/unit/org/apache/cassandra/cql3/ViewTest.java| 9 -
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/src/java/org/apache/cassandra/cql3/statements/AlterViewStatement.java 
b/src/java/org/apache/cassandra/cql3/statements/AlterViewStatement.java
index ea87cfd..91c5462 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterViewStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterViewStatement.java
@@ -79,9 +79,10 @@ public class AlterViewStatement extends 
SchemaAlteringStatement
 
 if (params.defaultTimeToLive > 0)
 {
-throw new InvalidRequestException("Cannot set or alter 
default_time_to_live for a materialized view. " +
+throw new InvalidRequestException("Forbidden default_time_to_live 
detected for a materialized view. " +
   "Data in a materialized view 
always expire at the same time than " +
-  "the corresponding data in the 
parent table.");
+  "the corresponding data in the 
parent table. default_time_to_live " +
+  "must be set to zero, see 
CASSANDRA-12868 for more information");
 }
 
 viewCopy.metadata.params(params);
diff --git a/test/unit/org/apache/cassandra/cql3/ViewTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewTest.java
index db742f7..6dd6a85 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewTest.java
@@ -1380,16 +1380,23 @@ public class ViewTest extends CQLTester
 "c int, " +
 "val int) WITH default_time_to_live = 60");
 
+execute("USE " + keyspace());
+executeNet(protocolVersion, "USE " + keyspace());
+
 createView("mv_ttl2", "CREATE MATERIALIZED VIEW %s AS SELECT * FROM 
%%s WHERE k IS NOT NULL AND c IS NOT NULL PRIMARY KEY (k,c)");
 
 // Must NOT include "default_time_to_live" on alter Materialized View
 try
 {
-executeNet(protocolVersion, "ALTER MATERIALIZED VIEW %s WITH 
default_time_to_live = 30");
+executeNet(protocolVersion, "ALTER MATERIALIZED VIEW " + 
keyspace() + ".mv_ttl2 WITH default_time_to_live = 30");
 fail("Should fail if TTL is provided while altering materialized 
view");
 }
 catch (Exception e)
 {
+// Make sure the message is clear. See CASSANDRA-16960
+assertEquals("Forbidden default_time_to_live detected for a 
materialized view. Data in a materialized view always expire at the same time 
than the corresponding "
+ + "data in the parent table. default_time_to_live 
must be set to zero, see CASSANDRA-12868 for more information",
+ e.getMessage());
 }
 }
 

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (14af149 -> e98be8e)

2021-09-20 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 14af149  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 8f4ae7d  Improve MV TTL error message
 new e98be8e  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/statements/schema/AlterViewStatement.java  |  5 +++--
 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java| 11 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (7c3935c -> e603418)

2021-09-20 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 7c3935c  Merge branch 'cassandra-4.0' into trunk
 new 8f4ae7d  Improve MV TTL error message
 new e98be8e  Merge branch 'cassandra-3.11' into cassandra-4.0
 new e603418  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/statements/schema/AlterViewStatement.java  |  5 +++--
 test/unit/org/apache/cassandra/cql3/ViewTimesTest.java| 11 ++-
 2 files changed, 13 insertions(+), 3 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated: Add indication in cassandra.yaml that rpc timeouts going too high will cause memory build up

2021-09-29 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 7c067b6  Add indication in cassandra.yaml that rpc timeouts going too 
high will cause memory build up
7c067b6 is described below

commit 7c067b6d7de84b988dc1cd465313d413674283fe
Author: Bereng 
AuthorDate: Mon Sep 27 10:36:58 2021 +0200

Add indication in cassandra.yaml that rpc timeouts going too high will 
cause memory build up

patch by Berenguer Blasi, Jeremy Hanna; reviewed by Andres de la Peña for 
CASSANDRA-8969

Co-authored-by: Berenguer Blasi 
Co-authored-by: Jeremy Hanna 
---
 conf/cassandra.yaml | 13 +
 1 file changed, 13 insertions(+)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 0626f4c..48bf0b4 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -852,6 +852,19 @@ sstable_preemptive_open_interval_in_mb: 50
 # When unset, the default is 200 Mbps or 25 MB/s
 # inter_dc_stream_throughput_outbound_megabits_per_sec: 200
 
+# Server side timeouts for requests. The server will return a timeout exception
+# to the client if it can't complete an operation within the corresponding
+# timeout. Those settings are a protection against:
+#   1) having client wait on an operation that might never terminate due to 
some
+#  failures.
+#   2) operations that use too much CPU/read too much data (leading to memory 
build
+#  up) by putting a limit to how long an operation will execute.
+# For this reason, you should avoid putting these settings too high. In other 
words, 
+# if you are timing out requests because of underlying resource constraints 
then 
+# increasing the timeout will just cause more problems. Of course putting them 
too 
+# low is equally ill-advised since clients could get timeouts even for 
successful 
+# operations just because the timeout setting is too tight.
+
 # How long the coordinator should wait for read operations to complete
 read_request_timeout_in_ms: 5000
 # How long the coordinator should wait for seq or index scans to complete

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated (5d457bc -> 42905e9)

2021-09-29 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 5d457bc  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 7c067b6  Add indication in cassandra.yaml that rpc timeouts going too 
high will cause memory build up
 new 42905e9  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 conf/cassandra.yaml | 13 +
 1 file changed, 13 insertions(+)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-09-29 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 42905e94b52f5c88be78e3224a646bfec6f100c4
Merge: 5d457bc 7c067b6
Author: Bereng 
AuthorDate: Thu Sep 30 07:46:16 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 conf/cassandra.yaml | 13 +
 1 file changed, 13 insertions(+)

diff --cc conf/cassandra.yaml
index 46d94d9,48bf0b4..2af8fc4
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@@ -893,21 -852,29 +893,34 @@@ sstable_preemptive_open_interval_in_mb
  # When unset, the default is 200 Mbps or 25 MB/s
  # inter_dc_stream_throughput_outbound_megabits_per_sec: 200
  
+ # Server side timeouts for requests. The server will return a timeout 
exception
+ # to the client if it can't complete an operation within the corresponding
+ # timeout. Those settings are a protection against:
+ #   1) having client wait on an operation that might never terminate due to 
some
+ #  failures.
+ #   2) operations that use too much CPU/read too much data (leading to memory 
build
+ #  up) by putting a limit to how long an operation will execute.
+ # For this reason, you should avoid putting these settings too high. In other 
words, 
+ # if you are timing out requests because of underlying resource constraints 
then 
+ # increasing the timeout will just cause more problems. Of course putting 
them too 
+ # low is equally ill-advised since clients could get timeouts even for 
successful 
+ # operations just because the timeout setting is too tight.
+ 
 -# How long the coordinator should wait for read operations to complete
 +# How long the coordinator should wait for read operations to complete.
 +# Lowest acceptable value is 10 ms.
  read_request_timeout_in_ms: 5000
 -# How long the coordinator should wait for seq or index scans to complete
 +# How long the coordinator should wait for seq or index scans to complete.
 +# Lowest acceptable value is 10 ms.
  range_request_timeout_in_ms: 1
 -# How long the coordinator should wait for writes to complete
 +# How long the coordinator should wait for writes to complete.
 +# Lowest acceptable value is 10 ms.
  write_request_timeout_in_ms: 2000
 -# How long the coordinator should wait for counter writes to complete
 +# How long the coordinator should wait for counter writes to complete.
 +# Lowest acceptable value is 10 ms.
  counter_write_request_timeout_in_ms: 5000
  # How long a coordinator should continue to retry a CAS operation
 -# that contends with other proposals for the same row
 +# that contends with other proposals for the same row.
 +# Lowest acceptable value is 10 ms.
  cas_contention_timeout_in_ms: 1000
  # How long the coordinator should wait for truncates to complete
  # (This can be much longer, because unless auto_snapshot is disabled

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (15a2fe0 -> 6e35f30)

2021-09-29 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 15a2fe0  [CASSANDRA-16923] CEP-10 Phase 1: Mockable System Clock
 new 7c067b6  Add indication in cassandra.yaml that rpc timeouts going too 
high will cause memory build up
 new 42905e9  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 6e35f30  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 conf/cassandra.yaml | 13 +
 1 file changed, 13 insertions(+)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-09-29 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 6e35f30f665fe73fcb6e6607f1bf303b09638f47
Merge: 15a2fe0 42905e9
Author: Bereng 
AuthorDate: Thu Sep 30 07:47:40 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 conf/cassandra.yaml | 13 +
 1 file changed, 13 insertions(+)


-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-09-24 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 92baa924d4d2d09a6bae4ddb70add600562f1420
Merge: c648412 e8c6752
Author: Bereng 
AuthorDate: Fri Sep 24 08:36:20 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../apache/cassandra/auth/FunctionResource.java|   5 +-
 .../cassandra/auth/FunctionResourceTest.java   | 116 +
 2 files changed, 120 insertions(+), 1 deletion(-)

diff --cc test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
index 000,07a4b10..c3caedd
mode 00,100644..100644
--- a/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
+++ b/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
@@@ -1,0 -1,117 +1,116 @@@
+ /*
+  * 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.auth;
+ 
+ import java.util.ArrayList;
+ import java.util.List;
+ 
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.db.marshal.AbstractType;
+ import org.apache.cassandra.db.marshal.TypeParser;
+ 
+ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+ import static org.junit.Assert.assertEquals;
+ 
+ public class FunctionResourceTest
+ {
+ private static final String ks = "fr_ks";
+ private static final String func = "functions";
+ private static final String name = "concat";
+ private static final String varType = 
"org.apache.cassandra.db.marshal.UTF8Type";
+ 
+ @Test
+ public void testFunction() throws Exception
+ {
+ FunctionResource expected = FunctionResource.root();
+ FunctionResource actual = FunctionResource.fromName(func);
+ assertEquals(expected, actual);
+ assertEquals(expected.getName(), actual.getName());
+ }
+ 
+ @Test
+ public void testFunctionKeyspace() throws Exception
+ {
+ FunctionResource expected = FunctionResource.keyspace(ks);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s", func, ks));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
+ public void testFunctionWithSingleInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ argTypes.add(TypeParser.parse(varType));
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[%s]", func, ks, name, 
varType));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
+ public void testFunctionWithMultipleInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ argTypes.add(TypeParser.parse(varType));
+ argTypes.add(TypeParser.parse(varType));
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[%s^%s]", func, ks, name, 
varType, varType));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
+ public void testFunctionWithoutInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[]", func, ks, name));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ 
+ String error = "functions/fr_ks/concat is not a valid function 
resource name. It must end with \"[]\"";
+ 
assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> 
FunctionResource.fromName(String

[cassandra] branch cassandra-3.11 updated: ArrayIndexOutOfBoundsException in FunctionResource#fromName

2021-09-24 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new 1aa7fb1  ArrayIndexOutOfBoundsException in FunctionResource#fromName
1aa7fb1 is described below

commit 1aa7fb172f7f107f7b3a252721c501a20ee6e8aa
Author: Bereng 
AuthorDate: Mon Sep 20 10:21:11 2021 +0200

ArrayIndexOutOfBoundsException in FunctionResource#fromName

patch by kamlesh_ghoradkar, Berenguer Blasi; reviewed by Berenguer Blasi, 
Aleksei Zotov for CASSANDRA-16977

Co-authored-by: kamlesh_ghoradkar 
Co-authored-by: Berenguer Blasi 
---
 .../apache/cassandra/auth/FunctionResource.java|   5 +-
 .../cassandra/auth/FunctionResourceTest.java   | 115 +
 2 files changed, 119 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/auth/FunctionResource.java 
b/src/java/org/apache/cassandra/auth/FunctionResource.java
index 01a4de5..9a6c6ab 100644
--- a/src/java/org/apache/cassandra/auth/FunctionResource.java
+++ b/src/java/org/apache/cassandra/auth/FunctionResource.java
@@ -18,6 +18,7 @@
 package org.apache.cassandra.auth;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
@@ -176,8 +177,10 @@ public class FunctionResource implements IResource
 if (parts.length == 2)
 return keyspace(parts[1]);
 
+if (!name.matches("^.+\\[.*\\]$"))
+throw new IllegalArgumentException(String.format("%s is not a 
valid function resource name. It must end with \"[]\"", name));
 String[] nameAndArgs = StringUtils.split(parts[2], "[|]");
-return function(parts[1], nameAndArgs[0], 
argsListFromString(nameAndArgs[1]));
+return function(parts[1], nameAndArgs[0], nameAndArgs.length > 1 ? 
argsListFromString(nameAndArgs[1]) : Collections.emptyList());
 }
 
 /**
diff --git a/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java 
b/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
new file mode 100644
index 000..54da393
--- /dev/null
+++ b/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
@@ -0,0 +1,115 @@
+/*
+ * 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.auth;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import org.apache.cassandra.db.marshal.AbstractType;
+import org.apache.cassandra.db.marshal.TypeParser;
+
+import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+import static org.junit.Assert.assertEquals;
+
+public class FunctionResourceTest
+{
+private static final String ks = "fr_ks";
+private static final String func = "functions";
+private static final String name = "concat";
+private static final String varType = 
"org.apache.cassandra.db.marshal.UTF8Type";
+
+@Test
+public void testFunction() throws Exception
+{
+FunctionResource expected = FunctionResource.root();
+FunctionResource actual = FunctionResource.fromName(func);
+assertEquals(expected, actual);
+assertEquals(expected.getName(), actual.getName());
+}
+
+@Test
+public void testFunctionKeyspace() throws Exception
+{
+FunctionResource expected = FunctionResource.keyspace(ks);
+FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s", func, ks));
+assertEquals(expected, actual);
+assertEquals(expected.getKeyspace(), actual.getKeyspace());
+}
+
+@Test
+public void testFunctionWithSingleInputParameter() throws Exception
+{
+List> argTypes = new ArrayList<>();
+argTypes.add(TypeParser.parse(varType));
+FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[%s]", func, ks, name, 
varType));
+asser

[cassandra] branch cassandra-4.0 updated (50e0b40 -> e8c6752)

2021-09-24 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 50e0b40  Fix 
org.apache.cassandra.distributed.test.OptimiseStreamsRepairTest.randomTest
 new 1aa7fb1  ArrayIndexOutOfBoundsException in FunctionResource#fromName
 new e8c6752  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/auth/FunctionResource.java|   5 +-
 .../cassandra/auth/FunctionResourceTest.java   | 117 +
 2 files changed, 121 insertions(+), 1 deletion(-)
 create mode 100644 
test/unit/org/apache/cassandra/auth/FunctionResourceTest.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-09-24 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit e8c675250a3740c1e795cbe70ec5b474401fe688
Merge: 50e0b40 1aa7fb1
Author: Bereng 
AuthorDate: Fri Sep 24 08:34:42 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 .../apache/cassandra/auth/FunctionResource.java|   5 +-
 .../cassandra/auth/FunctionResourceTest.java   | 117 +
 2 files changed, 121 insertions(+), 1 deletion(-)

diff --cc test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
index 000,54da393..07a4b10
mode 00,100644..100644
--- a/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
+++ b/test/unit/org/apache/cassandra/auth/FunctionResourceTest.java
@@@ -1,0 -1,115 +1,117 @@@
+ /*
+  * 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.auth;
+ 
+ import java.util.ArrayList;
+ import java.util.List;
+ 
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.db.marshal.AbstractType;
+ import org.apache.cassandra.db.marshal.TypeParser;
+ 
+ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
+ import static org.junit.Assert.assertEquals;
+ 
+ public class FunctionResourceTest
+ {
+ private static final String ks = "fr_ks";
+ private static final String func = "functions";
+ private static final String name = "concat";
+ private static final String varType = 
"org.apache.cassandra.db.marshal.UTF8Type";
+ 
+ @Test
+ public void testFunction() throws Exception
+ {
+ FunctionResource expected = FunctionResource.root();
+ FunctionResource actual = FunctionResource.fromName(func);
+ assertEquals(expected, actual);
+ assertEquals(expected.getName(), actual.getName());
+ }
+ 
+ @Test
+ public void testFunctionKeyspace() throws Exception
+ {
+ FunctionResource expected = FunctionResource.keyspace(ks);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s", func, ks));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
+ public void testFunctionWithSingleInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ argTypes.add(TypeParser.parse(varType));
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[%s]", func, ks, name, 
varType));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
 -public void testFunctionWithMultipleInputParameters() throws Exception
++public void testFunctionWithMultipleInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ argTypes.add(TypeParser.parse(varType));
+ argTypes.add(TypeParser.parse(varType));
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[%s^%s]", func, ks, name, 
varType, varType));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ }
+ 
+ @Test
 -public void testFunctionWithoutInputParameters() throws Exception
++public void testFunctionWithoutInputParameter() throws Exception
+ {
+ List> argTypes = new ArrayList<>();
+ FunctionResource expected = FunctionResource.function(ks, name, 
argTypes);
+ FunctionResource actual = 
FunctionResource.fromName(String.format("%s/%s/%s[]", func, ks, name));
+ assertEquals(expected, actual);
+ assertEquals(expected.getKeyspace(), actual.getKeyspace());
+ 
+ String error = "functions/fr_ks/concat is not a valid function 
resource name. It must end with \"[]\&qu

[cassandra] branch trunk updated (c648412 -> 92baa92)

2021-09-24 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from c648412  Merge branch 'cassandra-4.0' into trunk
 new 1aa7fb1  ArrayIndexOutOfBoundsException in FunctionResource#fromName
 new e8c6752  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 92baa92  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/cassandra/auth/FunctionResource.java|   5 +-
 .../cassandra/auth/FunctionResourceTest.java   | 116 +
 2 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 
test/unit/org/apache/cassandra/auth/FunctionResourceTest.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated: utests_system_keyspace_directory - more than 500 tests failing on trunk

2021-11-19 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 8d3fd3a  utests_system_keyspace_directory - more than 500 tests 
failing on trunk
8d3fd3a is described below

commit 8d3fd3a97c5e277c80c846d3aa7b679018e8fab5
Author: Bereng 
AuthorDate: Fri Nov 19 08:32:32 2021 +0100

utests_system_keyspace_directory - more than 500 tests failing on trunk

patch by Berenguer Blasi; reviewed by Sam Tunnicliffe for CASSANDRA-17137
---
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 72af4c5..a9bcdaa 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -2941,7 +2941,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 private static ExecutorPlus[] createPerDiskFlushWriters(int 
numberOfExecutors, int flushWriters)
 {
 ExecutorPlus[] flushExecutors = new 
ExecutorPlus[numberOfExecutors];
-for (int i = 0; i < 
DatabaseDescriptor.getAllDataFileLocations().length; i++)
+for (int i = 0; i < numberOfExecutors; i++)
 {
 flushExecutors[i] = 
newThreadPool("PerDiskMemtableFlushWriter_"+i, flushWriters);
 }

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: ViewTests flaky on timeouts

2021-11-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 0764273  ViewTests flaky on timeouts
0764273 is described below

commit 0764273608f501036f1f68e51185067856b934db
Author: Bereng 
AuthorDate: Mon Nov 22 11:45:33 2021 +0100

ViewTests flaky on timeouts

patch by Berenguer Blasi; reviewed by Andres de la Peña for CASSANDRA-17167
---
 .../cql3/ViewComplexDeletionsPartialTest.java  | 227 +
 .../cassandra/cql3/ViewComplexDeletionsTest.java   | 191 +---
 .../cql3/ViewComplexLivenessLimitTest.java | 101 
 .../cassandra/cql3/ViewComplexLivenessTest.java|  67 +--
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   4 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java |  80 +---
 .../apache/cassandra/cql3/ViewComplexTester.java   |   4 +-
 .../cassandra/cql3/ViewComplexTombstoneTest.java   | 116 +
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   4 +-
 .../apache/cassandra/cql3/ViewFiltering2Test.java  | 452 +
 .../cql3/ViewFilteringClustering1Test.java |  58 +--
 .../cql3/ViewFilteringClustering2Test.java |  58 +--
 ...g2Test.java => ViewFilteringComplexPKTest.java} | 240 +-
 ...gPKTest.java => ViewFilteringSimplePKTest.java} | 328 +
 .../apache/cassandra/cql3/ViewFilteringTest.java   | 532 +
 ...ComplexTester.java => ViewFilteringTester.java} |  54 +--
 16 files changed, 1071 insertions(+), 1445 deletions(-)

diff --git 
a/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsPartialTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsPartialTest.java
new file mode 100644
index 000..377621e
--- /dev/null
+++ b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsPartialTest.java
@@ -0,0 +1,227 @@
+/*
+ * 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;
+
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.utils.FBUtilities;
+
+/* ViewComplexTest class has been split into multiple ones because of timeout 
issues (CASSANDRA-16670, CASSANDRA-17167)
+ * Any changes here check if they apply to the other classes:
+ * - ViewComplexUpdatesTest
+ * - ViewComplexDeletionsTest
+ * - ViewComplexTTLTest
+ * - ViewComplexTest
+ * - ViewComplexLivenessTest
+ * - ...
+ * - ViewComplex*Test
+ */
+public class ViewComplexDeletionsPartialTest extends ViewComplexTester
+{
+// for now, unselected column cannot be fully supported, SEE 
CASSANDRA-11500
+@Ignore
+@Test
+public void testPartialDeleteUnselectedColumn() throws Throwable
+{
+boolean flush = true;
+execute("USE " + keyspace());
+executeNet(version, "USE " + keyspace());
+createTable("CREATE TABLE %s (k int, c int, a int, b int, PRIMARY KEY 
(k, c))");
+String mv = createView("CREATE MATERIALIZED VIEW %s " +
+ "AS SELECT k,c FROM %%s WHERE k IS NOT NULL 
AND c IS NOT NULL PRIMARY KEY (k,c)");
+Keyspace ks = Keyspace.open(keyspace());
+ks.getColumnFamilyStore(mv).disableAutoCompaction();
+
+updateView("UPDATE %s USING TIMESTAMP 10 SET b=1 WHERE k=1 AND c=1");
+if (flush)
+FBUtilities.waitOnFutures(ks.flush());
+assertRows(execute("SELECT * from %s"), row(1, 1, null, 1));
+assertRows(execute("SELECT * from " + mv), row(1, 1));
+updateView("DELETE b FROM %s USING TIMESTAMP 11 WHERE k=1 AND c=1");
+if (flush)
+FBUtilities.waitOnFutures(ks.flush());
+assertEmpty(execute("SELECT * from %s"));
+assertEmpty(execute("SELECT * from " + mv));
+updateView("UPDATE %s USING TIMESTAMP 1 SET a=1 WHERE k=1 AND c=1");
+if (flush)
+FBUtilities.waitOnFu

[cassandra] branch trunk updated (951d72c -> a06eeda)

2021-11-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 951d72c  [CEP-10] Phase 4: Support CAS Add Operations
 new 0764273  ViewTests flaky on timeouts
 new a06eeda  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ...t.java => ViewComplexDeletionsPartialTest.java} | 239 +--
 .../cassandra/cql3/ViewComplexDeletionsTest.java   | 198 +
 .../cql3/ViewComplexLivenessLimitTest.java | 100 +
 .../cassandra/cql3/ViewComplexLivenessTest.java|  66 +--
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  |   4 +-
 .../org/apache/cassandra/cql3/ViewComplexTest.java |  78 +---
 .../cassandra/cql3/ViewComplexTombstoneTest.java   | 114 ++
 .../cassandra/cql3/ViewComplexUpdatesTest.java |   4 +-
 ...wFilteringTest.java => ViewFiltering1Test.java} | 407 +--
 .../apache/cassandra/cql3/ViewFiltering2Test.java  | 452 +
 .../cql3/ViewFilteringClustering1Test.java |   4 +-
 .../cql3/ViewFilteringClustering2Test.java |   4 +-
 ...g2Test.java => ViewFilteringComplexPKTest.java} | 175 
 ...gPKTest.java => ViewFilteringSimplePKTest.java} | 244 +--
 14 files changed, 801 insertions(+), 1288 deletions(-)
 copy test/unit/org/apache/cassandra/cql3/{ViewComplexDeletionsTest.java => 
ViewComplexDeletionsPartialTest.java} (50%)
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexLivenessLimitTest.java
 create mode 100644 
test/unit/org/apache/cassandra/cql3/ViewComplexTombstoneTest.java
 rename test/unit/org/apache/cassandra/cql3/{ViewFilteringTest.java => 
ViewFiltering1Test.java} (58%)
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewFiltering2Test.java
 copy test/unit/org/apache/cassandra/cql3/{ViewFilteringClustering2Test.java => 
ViewFilteringComplexPKTest.java} (66%)
 rename test/unit/org/apache/cassandra/cql3/{ViewFilteringPKTest.java => 
ViewFilteringSimplePKTest.java} (54%)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra-dtest] branch trunk updated: Broken test_speculative_data_request

2021-11-15 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 01a647f  Broken test_speculative_data_request
01a647f is described below

commit 01a647f4a1ec42d42198fe4c49fe654a7705d7d7
Author: Bereng 
AuthorDate: Mon Nov 8 07:45:47 2021 +0100

Broken test_speculative_data_request

patch by Berenguer Blasi; reviewed by Brandon Williams for CASSANDRA-17119
---
 byteman/{ => post4.0}/request_verb_timing.btm | 0
 byteman/request_verb_timing.btm   | 4 ++--
 read_repair_test.py   | 6 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/byteman/request_verb_timing.btm 
b/byteman/post4.0/request_verb_timing.btm
similarity index 100%
copy from byteman/request_verb_timing.btm
copy to byteman/post4.0/request_verb_timing.btm
diff --git a/byteman/request_verb_timing.btm b/byteman/request_verb_timing.btm
index c42968e..e0dc68e 100644
--- a/byteman/request_verb_timing.btm
+++ b/byteman/request_verb_timing.btm
@@ -3,10 +3,10 @@ CLASS org.apache.cassandra.net.MessagingService
 METHOD doSend
 AT ENTRY
 BIND prefix:String = "org.jboss.byteman."; # byteman in strict mode requires 
the o.j.b prefix
-toHost:String = $to.getAddress().toString();
+toHost:String = $to.address.toString();
 verb:String = $message.header.verb.toString();
 prop:String = prefix + "|request_verb_timing|" + toHost + "|" + verb;
 IF true
 DO
 System.setProperty(prop, String.valueOf(System.currentTimeMillis()));
-ENDRULE
+ENDRULE
\ No newline at end of file
diff --git a/read_repair_test.py b/read_repair_test.py
index f3cb6c2..ee189d5 100644
--- a/read_repair_test.py
+++ b/read_repair_test.py
@@ -606,7 +606,11 @@ class TestSpeculativeReadRepair(Tester):
 node2.byteman_submit(['-u', './byteman/read_repair/stop_writes.btm'])
 
 
node1.byteman_submit(['./byteman/read_repair/sorted_live_endpoints.btm'])
-node1.byteman_submit(['./byteman/request_verb_timing.btm'])
+version = self.cluster.cassandra_version()
+if version < '4.1':
+node1.byteman_submit(['./byteman/request_verb_timing.btm'])
+else:
+node1.byteman_submit(['./byteman/post4.0/request_verb_timing.btm'])
 
 with StorageProxy(node1) as storage_proxy:
 assert storage_proxy.blocking_read_repair == 0

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: Fix circle MID and HIGH for j11_jvm_dtests

2021-11-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 74b8015  Fix circle MID and HIGH for j11_jvm_dtests
74b8015 is described below

commit 74b80154bc52847f1f923857a4d2557b393878bb
Author: Bereng 
AuthorDate: Tue Nov 16 12:12:19 2021 +0100

Fix circle MID and HIGH for j11_jvm_dtests

patch by Berenguer Blasi; reviewed by Brandon Williams for CASSANDRA-17138
---
 .circleci/config-2_1.yml.high_res.patch |  6 +++---
 .circleci/config-2_1.yml.mid_res.patch  | 14 +++---
 .circleci/config.yml.HIGHRES|  2 +-
 .circleci/config.yml.MIDRES |  2 +-
 4 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/.circleci/config-2_1.yml.high_res.patch 
b/.circleci/config-2_1.yml.high_res.patch
index 45c54b2..d28f185 100644
--- a/.circleci/config-2_1.yml.high_res.patch
+++ b/.circleci/config-2_1.yml.high_res.patch
@@ -1,5 +1,5 @@
 .circleci/config-2_1.yml   2021-10-18 11:48:35.0 +0100
-+++ .circleci/config-2_1.yml.HIGHRES   2021-10-18 12:03:47.0 +0100
+--- config-2_1.yml 2021-11-12 11:02:52.301079060 +0100
 config-2_1.yml.HIGHRES 2021-11-16 12:04:20.083117123 +0100
 @@ -101,14 +101,14 @@
  j8_par_executor: _par_executor
executor:
@@ -58,7 +58,7 @@
 -#exec_resource_class: medium
 -  parallelism: 1
 +exec_resource_class: xlarge
-+  parallelism: 2
++  parallelism: 5
  
  j8_repeated_utest_executor: _repeated_utest_executor
executor:
diff --git a/.circleci/config-2_1.yml.mid_res.patch 
b/.circleci/config-2_1.yml.mid_res.patch
index 27df9cc..28021f6 100644
--- a/.circleci/config-2_1.yml.mid_res.patch
+++ b/.circleci/config-2_1.yml.mid_res.patch
@@ -1,5 +1,5 @@
 .circleci/config-2_1.yml   2021-10-18 11:48:35.0 +0100
-+++ .circleci/config-2_1.yml.MIDRES2021-10-18 12:02:44.0 +0100
+--- config-2_1.yml 2021-11-12 11:02:52.301079060 +0100
 config-2_1.yml.MIDRES  2021-11-16 11:53:09.052881200 +0100
 @@ -101,14 +101,14 @@
  j8_par_executor: _par_executor
executor:
@@ -19,7 +19,7 @@
  
  j8_small_executor: _small_executor
executor:
-@@ -119,20 +119,32 @@
+@@ -119,26 +119,38 @@
  j8_medium_par_executor: _medium_par_executor
executor:
  name: java8-executor
@@ -57,6 +57,14 @@
  
  j11_small_par_executor: _small_par_executor
executor:
+ name: java11-executor
+-#exec_resource_class: xlarge
+-  parallelism: 1
++#exec_resource_class: large
++  parallelism: 10
+ 
+ j11_small_executor: _small_executor
+   executor:
 @@ -146,35 +158,47 @@
  #exec_resource_class: medium
parallelism: 1
diff --git a/.circleci/config.yml.HIGHRES b/.circleci/config.yml.HIGHRES
index 9c21467..90aae8c 100644
--- a/.circleci/config.yml.HIGHRES
+++ b/.circleci/config.yml.HIGHRES
@@ -1994,7 +1994,7 @@ jobs:
 resource_class: xlarge
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 2
+parallelism: 5
 steps:
 - attach_workspace:
 at: /home/cassandra
diff --git a/.circleci/config.yml.MIDRES b/.circleci/config.yml.MIDRES
index b3ac410..7fb008b 100644
--- a/.circleci/config.yml.MIDRES
+++ b/.circleci/config.yml.MIDRES
@@ -1994,7 +1994,7 @@ jobs:
 resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 1
+parallelism: 10
 steps:
 - attach_workspace:
 at: /home/cassandra

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-11-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 5d781232ae9481bf6680eb644d838546c3f1df8e
Merge: a6cfd64 74b8015
Author: Bereng 
AuthorDate: Thu Nov 18 07:46:01 2021 +0100

Merge branch 'cassandra-4.0' into trunk

 .circleci/config-2_1.yml.high_res.patch |  6 +++---
 .circleci/config-2_1.yml.mid_res.patch  | 14 +++---
 .circleci/config.yml.HIGHRES|  2 +-
 .circleci/config.yml.MIDRES |  2 +-
 4 files changed, 16 insertions(+), 8 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch trunk updated (a6cfd64 -> 5d78123)

2021-11-17 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from a6cfd64  Merge branch 'cassandra-4.0' into trunk
 new 74b8015  Fix circle MID and HIGH for j11_jvm_dtests
 new 5d78123  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .circleci/config-2_1.yml.high_res.patch |  6 +++---
 .circleci/config-2_1.yml.mid_res.patch  | 14 +++---
 .circleci/config.yml.HIGHRES|  2 +-
 .circleci/config.yml.MIDRES |  2 +-
 4 files changed, 16 insertions(+), 8 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-4.0 updated: ViewComplexTest hardening

2021-11-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
 new 8ba8f0b  ViewComplexTest hardening
8ba8f0b is described below

commit 8ba8f0b841ba772dcdaf8b5109b7d3fda87b6888
Author: Bereng 
AuthorDate: Fri Oct 29 08:26:34 2021 +0200

ViewComplexTest hardening

patch by Andres de la Peña, Berenguer Blasi; reviewed by Andres de la Peña 
for CASSANDRA-17070

Co-authored-by: Andres de la Peña 
Co-authored-by: Berenguer Blasi 
---
 .../cassandra/cql3/ViewComplexDeletionsTest.java   | 290 -
 .../cassandra/cql3/ViewComplexLivenessTest.java| 126 +++--
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  | 138 --
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 196 --
 .../apache/cassandra/cql3/ViewComplexTester.java   | 130 +
 .../cassandra/cql3/ViewComplexUpdatesTest.java | 204 ++-
 6 files changed, 452 insertions(+), 632 deletions(-)

diff --git a/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
index 51852ce..33fa6d9 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewComplexDeletionsTest.java
@@ -18,32 +18,23 @@
 
 package org.apache.cassandra.cql3;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
+import java.util.Comparator;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.SystemKeyspace;
 import org.apache.cassandra.db.compaction.CompactionManager;
+import org.apache.cassandra.io.sstable.format.SSTableReader;
 import org.apache.cassandra.schema.SchemaConstants;
-import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.utils.FBUtilities;
 
-import static org.apache.cassandra.cql3.ViewComplexTest.createView;
-import static org.apache.cassandra.cql3.ViewComplexTest.updateView;
-import static org.apache.cassandra.cql3.ViewComplexTest.updateViewWithFlush;
 import static org.junit.Assert.assertEquals;
 
 /* ViewComplexTest class has been split into multiple ones because of timeout 
issues (CASSANDRA-16670)
@@ -54,38 +45,8 @@ import static org.junit.Assert.assertEquals;
  * - ViewComplexTest
  * - ViewComplexLivenessTest
  */
-@RunWith(Parameterized.class)
-public class ViewComplexDeletionsTest extends CQLTester
+public class ViewComplexDeletionsTest extends ViewComplexTester
 {
-@Parameterized.Parameter
-public ProtocolVersion version;
-
-@Parameterized.Parameters()
-public static Collection versions()
-{
-return ViewComplexTest.versions();
-}
-
-private final List views = new ArrayList<>();
-
-@BeforeClass
-public static void startup()
-{
-ViewComplexTest.startup();
-}
-
-@Before
-public void begin()
-{
-ViewComplexTest.beginSetup(views);
-}
-
-@After
-public void end() throws Throwable
-{
-ViewComplexTest.endTearDown(views, version, this);
-}
-
 // for now, unselected column cannot be fully supported, SEE 
CASSANDRA-11500
 @Ignore
 @Test
@@ -95,44 +56,41 @@ public class ViewComplexDeletionsTest extends CQLTester
 execute("USE " + keyspace());
 executeNet(version, "USE " + keyspace());
 createTable("CREATE TABLE %s (k int, c int, a int, b int, PRIMARY KEY 
(k, c))");
-createView("mv",
-   "CREATE MATERIALIZED VIEW %s AS SELECT k,c FROM %%s WHERE k 
IS NOT NULL AND c IS NOT NULL PRIMARY KEY (k,c)",
-   version,
-   this,
-   views);
+String mv = createView("CREATE MATERIALIZED VIEW %s " +
+ "AS SELECT k,c FROM %%s WHERE k IS NOT NULL 
AND c IS NOT NULL PRIMARY KEY (k,c)");
 Keyspace ks = Keyspace.open(keyspace());
-ks.getColumnFamilyStore("mv").disableAutoCompaction();
+ks.getColumnFamilyStore(mv).disableAutoCompaction();
 
-updateView("UPDATE %s USING TIMESTAMP 10 SET b=1 WHERE k=1 AND c=1", 
version, this);
+updateView("UPDATE %s USING TIMESTAMP 10 SET b=1 WHERE k=1 AND c=1");
 if (flush)
 FBUtilities.waitOnFutures(ks.flush());
 assertRows(execute("SELECT * from %s"), row(1, 1,

[cassandra] branch trunk updated (5b4d369 -> 185c523)

2021-11-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 5b4d369  coordinator_read_size had wrong name in cassandra.yaml
 new 8ba8f0b  ViewComplexTest hardening
 new 185c523  Merge branch 'cassandra-4.0' into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cassandra/cql3/ViewComplexDeletionsTest.java   | 290 -
 .../cassandra/cql3/ViewComplexLivenessTest.java| 126 +++--
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  | 138 --
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 196 --
 .../apache/cassandra/cql3/ViewComplexTester.java   | 130 +
 .../cassandra/cql3/ViewComplexUpdatesTest.java | 204 ++-
 6 files changed, 452 insertions(+), 632 deletions(-)
 create mode 100644 test/unit/org/apache/cassandra/cql3/ViewComplexTester.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-11-04 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 185c5232a693a8e661926dfad3c0536327a4cb79
Merge: 5b4d369 8ba8f0b
Author: Bereng 
AuthorDate: Thu Nov 4 08:12:40 2021 +0100

Merge branch 'cassandra-4.0' into trunk

 .../cassandra/cql3/ViewComplexDeletionsTest.java   | 290 -
 .../cassandra/cql3/ViewComplexLivenessTest.java| 126 +++--
 .../apache/cassandra/cql3/ViewComplexTTLTest.java  | 138 --
 .../org/apache/cassandra/cql3/ViewComplexTest.java | 196 --
 .../apache/cassandra/cql3/ViewComplexTester.java   | 130 +
 .../cassandra/cql3/ViewComplexUpdatesTest.java | 204 ++-
 6 files changed, 452 insertions(+), 632 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] branch cassandra-3.11 updated: Prevent broken concurrent schema read/writes

2021-10-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
 new fa532a6  Prevent broken concurrent schema read/writes
fa532a6 is described below

commit fa532a61f810b428ccfdf4964684794a7fc0e885
Author: Bereng 
AuthorDate: Wed Oct 20 10:44:50 2021 +0200

Prevent broken concurrent schema read/writes

patch by Berenguer Blasi; reviewed by Caleb Rackliffe for CASSANDRA-16996

Co-authored-by: Berenguer Blasi 
Co-authored-by: Caleb Rackliffe 
---
 src/java/org/apache/cassandra/db/Keyspace.java |   2 +-
 .../apache/cassandra/schema/SchemaKeyspace.java| 175 +++--
 .../cassandra/schema/SchemaKeyspaceTables.java |  77 +
 .../org/apache/cassandra/service/ClientState.java  |  16 +-
 .../cassandra/utils/NativeSSTableLoaderClient.java |  41 +++--
 .../apache/cassandra/config/CFMetaDataTest.java|   8 +-
 .../cassandra/cql3/PstmtPersistenceTest.java   |   8 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   3 +-
 .../cql3/validation/operations/AlterTest.java  |  14 +-
 .../cql3/validation/operations/CreateTest.java |  20 +--
 .../operations/InsertUpdateIfConditionTest.java|  11 +-
 .../cassandra/schema/SchemaKeyspaceTest.java   |  91 ++-
 .../service/StorageServiceServerTest.java  |  17 +-
 13 files changed, 340 insertions(+), 143 deletions(-)

diff --git a/src/java/org/apache/cassandra/db/Keyspace.java 
b/src/java/org/apache/cassandra/db/Keyspace.java
index 5e39823..eb3de5a 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -452,7 +452,7 @@ public class Keyspace
 
 /**
  * If apply is blocking, apply must not be deferred
- * Otherwise there is a race condition where ALL mutation workers are 
beeing blocked ending
+ * Otherwise there is a race condition where ALL mutation workers are 
being blocked ending
  * in a complete deadlock of the mutation stage. See CASSANDRA-12689.
  *
  * @param mutation   the row to write.  Must not be modified after 
calling apply, since commitlog append
diff --git a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java 
b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
index 7dc6b23..6b0089f 100644
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
@@ -21,40 +21,82 @@ import java.nio.ByteBuffer;
 import java.nio.charset.CharacterCodingException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.*;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.MapDifference;
 import com.google.common.collect.Maps;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.config.*;
+import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.CFMetaData.DroppedColumn;
+import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.config.ColumnDefinition.ClusteringOrder;
-import org.apache.cassandra.cql3.*;
-import org.apache.cassandra.cql3.functions.*;
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.config.Schema;
+import org.apache.cassandra.config.SchemaConstants;
+import org.apache.cassandra.config.ViewDefinition;
+import org.apache.cassandra.cql3.CQL3Type;
+import org.apache.cassandra.cql3.ColumnIdentifier;
+import org.apache.cassandra.cql3.FieldIdentifier;
+import org.apache.cassandra.cql3.QueryProcessor;
+import org.apache.cassandra.cql3.Terms;
+import org.apache.cassandra.cql3.UntypedResultSet;
+import org.apache.cassandra.cql3.functions.AbstractFunction;
+import org.apache.cassandra.cql3.functions.FunctionName;
+import org.apache.cassandra.cql3.functions.UDAggregate;
+import org.apache.cassandra.cql3.functions.UDFunction;
 import org.apache.cassandra.cql3.statements.SelectStatement;
-import org.apache.cassandra.db.*;
-import org.apache.cassandra.db.marshal.*;
-import org.apache.cassandra.db.partitions.*;
-import org.apache.cassandra.db.rows.*;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.db.Mutation;
+import

[cassandra] branch trunk updated (8e225c5 -> 7d0cb20)

2021-10-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from 8e225c5  v4+ protocol did not clean up client warnings, which caused 
leaking the state
 new fa532a6  Prevent broken concurrent schema read/writes
 new 5aa2fb8  Merge branch 'cassandra-3.11' into cassandra-4.0
 new 7d0cb20  Merge branch 'cassandra-4.0' into trunk

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/db/SystemKeyspace.java|   2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java |   2 +-
 .../apache/cassandra/schema/MigrationManager.java  |   2 +-
 src/java/org/apache/cassandra/schema/Schema.java   |  41 -
 .../apache/cassandra/schema/SchemaKeyspace.java|  43 +++--
 .../cassandra/schema/SchemaKeyspaceTables.java |  59 
 .../cassandra/schema/SchemaPullVerbHandler.java|   2 +-
 .../org/apache/cassandra/service/ClientState.java  |   4 +-
 .../cassandra/utils/NativeSSTableLoaderClient.java |  10 +-
 .../distributed/test/metric/TableMetricTest.java   |   2 +-
 .../cassandra/cql3/PstmtPersistenceTest.java   |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   4 +-
 .../cql3/validation/operations/AlterTest.java  |  16 ++--
 .../cql3/validation/operations/CreateTest.java |  20 ++--
 .../operations/InsertUpdateIfConditionTest.java|  12 +--
 .../org/apache/cassandra/db/DirectoriesTest.java   |   6 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java|   3 +-
 .../cassandra/schema/SchemaKeyspaceTest.java   | 102 +
 .../service/StorageServiceServerTest.java  |   2 +-
 19 files changed, 242 insertions(+), 94 deletions(-)
 create mode 100644 
src/java/org/apache/cassandra/schema/SchemaKeyspaceTables.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-3.11' into cassandra-4.0

2021-10-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 5aa2fb83e7abff89cf6c59583cdffb5439032c5b
Merge: e8d905e fa532a6
Author: Bereng 
AuthorDate: Tue Oct 26 07:37:33 2021 +0200

Merge branch 'cassandra-3.11' into cassandra-4.0

 .../org/apache/cassandra/db/SystemKeyspace.java|  2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java |  2 +-
 .../apache/cassandra/schema/MigrationManager.java  |  2 +-
 src/java/org/apache/cassandra/schema/Schema.java   | 42 +-
 .../apache/cassandra/schema/SchemaKeyspace.java| 43 +++---
 .../cassandra/schema/SchemaKeyspaceTables.java | 62 ++
 .../cassandra/schema/SchemaPullVerbHandler.java|  2 +-
 .../org/apache/cassandra/service/ClientState.java  |  4 +-
 .../cassandra/utils/NativeSSTableLoaderClient.java | 14 ++--
 .../distributed/test/metric/TableMetricTest.java   |  3 +-
 .../cassandra/cql3/PstmtPersistenceTest.java   |  4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |  4 +-
 .../cql3/validation/operations/AlterTest.java  | 16 ++--
 .../cql3/validation/operations/CreateTest.java | 20 ++---
 .../operations/InsertUpdateIfConditionTest.java| 12 +--
 .../org/apache/cassandra/db/DirectoriesTest.java   |  6 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java|  4 +-
 .../cassandra/schema/SchemaKeyspaceTest.java   | 94 +++---
 .../service/StorageServiceServerTest.java  |  2 +-
 19 files changed, 241 insertions(+), 97 deletions(-)

diff --cc src/java/org/apache/cassandra/db/SystemKeyspace.java
index 34973cb,ec26a69..930d09b
--- a/src/java/org/apache/cassandra/db/SystemKeyspace.java
+++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java
@@@ -462,7 -497,7 +462,7 @@@ public final class SystemKeyspac
  
  public static void finishStartup()
  {
--SchemaKeyspace.saveSystemKeyspacesSchema();
++Schema.instance.saveSystemKeyspace();
  }
  
  public static void persistLocalMetadata()
diff --cc src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 0ac189c,694fe37..8ac0fdf
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@@ -502,16 -513,16 +502,16 @@@ public class CQLSSTableWriter implement
  
  synchronized (CQLSSTableWriter.class)
  {
 -if 
(Schema.instance.getKSMetaData(SchemaConstants.SCHEMA_KEYSPACE_NAME) == null)
 -Schema.instance.load(SchemaKeyspace.metadata());
 -if 
(Schema.instance.getKSMetaData(SchemaConstants.SYSTEM_KEYSPACE_NAME) == null)
 +if 
(Schema.instance.getKeyspaceMetadata(SchemaConstants.SCHEMA_KEYSPACE_NAME) == 
null)
- Schema.instance.load(SchemaKeyspace.metadata());
++Schema.instance.load(Schema.getSystemKeyspaceMetadata());
 +if 
(Schema.instance.getKeyspaceMetadata(SchemaConstants.SYSTEM_KEYSPACE_NAME) == 
null)
  Schema.instance.load(SystemKeyspace.metadata());
  
 -String keyspace = schemaStatement.keyspace();
 +String keyspaceName = schemaStatement.keyspace();
  
 -if (Schema.instance.getKSMetaData(keyspace) == null)
 +if (Schema.instance.getKeyspaceMetadata(keyspaceName) == null)
  {
 -Schema.instance.load(KeyspaceMetadata.create(keyspace,
 +Schema.instance.load(KeyspaceMetadata.create(keyspaceName,
   
KeyspaceParams.simple(1),
   
Tables.none(),
   Views.none(),
diff --cc src/java/org/apache/cassandra/schema/MigrationManager.java
index 87fb603,000..9ebd33d
mode 100644,00..100644
--- a/src/java/org/apache/cassandra/schema/MigrationManager.java
+++ b/src/java/org/apache/cassandra/schema/MigrationManager.java
@@@ -1,365 -1,0 +1,365 @@@
 +/*
 + * 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 specifi

[cassandra] branch cassandra-4.0 updated (e8d905e -> 5aa2fb8)

2021-10-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a change to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


from e8d905e  Merge branch 'cassandra-3.11' into cassandra-4.0
 new fa532a6  Prevent broken concurrent schema read/writes
 new 5aa2fb8  Merge branch 'cassandra-3.11' into cassandra-4.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/cassandra/db/SystemKeyspace.java|  2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java |  2 +-
 .../apache/cassandra/schema/MigrationManager.java  |  2 +-
 src/java/org/apache/cassandra/schema/Schema.java   | 42 +-
 .../apache/cassandra/schema/SchemaKeyspace.java| 43 +++---
 .../cassandra/schema/SchemaKeyspaceTables.java | 62 ++
 .../cassandra/schema/SchemaPullVerbHandler.java|  2 +-
 .../org/apache/cassandra/service/ClientState.java  |  4 +-
 .../cassandra/utils/NativeSSTableLoaderClient.java | 14 ++--
 .../distributed/test/metric/TableMetricTest.java   |  3 +-
 .../cassandra/cql3/PstmtPersistenceTest.java   |  4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |  4 +-
 .../cql3/validation/operations/AlterTest.java  | 16 ++--
 .../cql3/validation/operations/CreateTest.java | 20 ++---
 .../operations/InsertUpdateIfConditionTest.java| 12 +--
 .../org/apache/cassandra/db/DirectoriesTest.java   |  6 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java|  4 +-
 .../cassandra/schema/SchemaKeyspaceTest.java   | 94 +++---
 .../service/StorageServiceServerTest.java  |  2 +-
 19 files changed, 241 insertions(+), 97 deletions(-)
 create mode 100644 
src/java/org/apache/cassandra/schema/SchemaKeyspaceTables.java

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk

2021-10-25 Thread bereng
This is an automated email from the ASF dual-hosted git repository.

bereng pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 7d0cb2015d76a82a9baf1c4769345ebb5194f212
Merge: 8e225c5 5aa2fb8
Author: Bereng 
AuthorDate: Tue Oct 26 07:44:20 2021 +0200

Merge branch 'cassandra-4.0' into trunk

 .../org/apache/cassandra/db/SystemKeyspace.java|   2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java |   2 +-
 .../apache/cassandra/schema/MigrationManager.java  |   2 +-
 src/java/org/apache/cassandra/schema/Schema.java   |  41 -
 .../apache/cassandra/schema/SchemaKeyspace.java|  43 +++--
 .../cassandra/schema/SchemaKeyspaceTables.java |  59 
 .../cassandra/schema/SchemaPullVerbHandler.java|   2 +-
 .../org/apache/cassandra/service/ClientState.java  |   4 +-
 .../cassandra/utils/NativeSSTableLoaderClient.java |  10 +-
 .../distributed/test/metric/TableMetricTest.java   |   2 +-
 .../cassandra/cql3/PstmtPersistenceTest.java   |   4 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   4 +-
 .../cql3/validation/operations/AlterTest.java  |  16 ++--
 .../cql3/validation/operations/CreateTest.java |  20 ++--
 .../operations/InsertUpdateIfConditionTest.java|  12 +--
 .../org/apache/cassandra/db/DirectoriesTest.java   |   6 +-
 .../apache/cassandra/db/SystemKeyspaceTest.java|   3 +-
 .../cassandra/schema/SchemaKeyspaceTest.java   | 102 +
 .../service/StorageServiceServerTest.java  |   2 +-
 19 files changed, 242 insertions(+), 94 deletions(-)

diff --cc src/java/org/apache/cassandra/schema/SchemaKeyspace.java
index e8c22b1,b4a322f..6d5e331
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspace.java
@@@ -58,8 -61,11 +61,11 @@@ import static org.apache.cassandra.sche
  
  /**
   * system_schema.* tables and methods for manipulating them.
+  * 
+  * Please notice this class is _not_ thread safe. It should be accessed 
through {@link org.apache.cassandra.schema.Schema}. See CASSANDRA-16856/16996
   */
+ @NotThreadSafe
 -final class SchemaKeyspace
 +public final class SchemaKeyspace
  {
  private SchemaKeyspace()
  {
@@@ -101,7 -80,7 +80,7 @@@
   * The tables to which we added the cdc column. This is used in {@link 
#makeUpdateForSchema} below to make sure we skip that
   * column is cdc is disabled as the columns breaks pre-cdc to post-cdc 
upgrades (typically, 3.0 -> 3.X).
   */
--private static final Set TABLES_WITH_CDC_ADDED = 
ImmutableSet.of(TABLES, VIEWS);
++private static final Set TABLES_WITH_CDC_ADDED = 
ImmutableSet.of(SchemaKeyspaceTables.TABLES, SchemaKeyspaceTables.VIEWS);
  
  private static final TableMetadata Keyspaces =
  parse(KEYSPACES,
diff --cc src/java/org/apache/cassandra/schema/SchemaKeyspaceTables.java
index 000,b6e825d..c00a4f7
mode 00,100644..100644
--- a/src/java/org/apache/cassandra/schema/SchemaKeyspaceTables.java
+++ b/src/java/org/apache/cassandra/schema/SchemaKeyspaceTables.java
@@@ -1,0 -1,62 +1,59 @@@
+ /*
+  * 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.schema;
+ 
+ import com.google.common.collect.ImmutableList;
+ 
 -public final class SchemaKeyspaceTables
++public class SchemaKeyspaceTables
+ {
 -public static final String INDEXES = "indexes";
 -public static final String AGGREGATES = "aggregates";
 -public static final String FUNCTIONS = "functions";
 -public static final String TYPES = "types";
 -public static final String VIEWS = "views";
 -public static final String TRIGGERS = "triggers";
 -public static final String DROPPED_COLUMNS = "dropped_columns";
 -public static final String COLUMNS = "columns";
 -public static final String TABLES = "tables";
+ public static final String KEYSPACES = "keyspaces";
 -
++public static final String TABLES = "tables";
++public static final String COLUMNS = "columns";
++public static f

  1   2   3   4   >