(cassandra) branch trunk updated: remove unused import

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

marcuse 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 a9dbb89419 remove unused import
a9dbb89419 is described below

commit a9dbb8941973bcdb6ad72047ae92a42480987d73
Author: Marcus Eriksson 
AuthorDate: Mon May 6 09:30:22 2024 +0200

remove unused import
---
 src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanup.java | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanup.java 
b/src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanup.java
index 331adef64f..23be99f000 100644
--- a/src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanup.java
+++ b/src/java/org/apache/cassandra/service/paxos/cleanup/PaxosCleanup.java
@@ -33,7 +33,6 @@ import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.gms.EndpointState;
 import org.apache.cassandra.locator.InetAddressAndPort;
 import org.apache.cassandra.repair.SharedContext;
-import org.apache.cassandra.schema.Keyspaces;
 import org.apache.cassandra.schema.Schema;
 import org.apache.cassandra.schema.TableId;
 import org.apache.cassandra.schema.TableMetadata;


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



(cassandra) branch trunk updated: Raise priority of TCM internode messages during critical operations

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

marcuse 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 67139d5c33 Raise priority of TCM internode messages during critical 
operations
67139d5c33 is described below

commit 67139d5c334e58fdc8d9f09f9288155448666cd3
Author: Alex Petrov 
AuthorDate: Tue Mar 26 11:52:17 2024 +0100

Raise priority of TCM internode messages during critical operations

Patch by Alex Petrov; reviewed by Sam Tunnicliffe and marcuse for 
CASSANDRA-19517.
---
 CHANGES.txt|  1 +
 src/java/org/apache/cassandra/net/Message.java | 21 +-
 src/java/org/apache/cassandra/net/MessageFlag.java |  4 +-
 .../org/apache/cassandra/net/MessagingService.java |  8 +++
 .../apache/cassandra/net/OutboundConnections.java  |  7 +-
 src/java/org/apache/cassandra/net/Verb.java| 30 -
 .../org/apache/cassandra/schema/Keyspaces.java |  9 +++
 .../org/apache/cassandra/service/paxos/Paxos.java  |  5 ++
 .../cassandra/service/paxos/PaxosCommit.java   |  8 ++-
 .../service/paxos/PaxosCommitAndPrepare.java   |  4 +-
 .../cassandra/service/paxos/PaxosPrepare.java  |  2 +-
 .../service/paxos/PaxosPrepareRefresh.java |  2 +-
 .../cassandra/service/paxos/PaxosPropose.java  |  2 +-
 .../cassandra/service/paxos/PaxosRepair.java   |  3 +-
 .../service/paxos/cleanup/PaxosCleanup.java| 11 ++--
 .../paxos/cleanup/PaxosCleanupComplete.java|  8 ++-
 .../service/paxos/cleanup/PaxosCleanupRequest.java | 12 ++--
 .../service/paxos/cleanup/PaxosCleanupSession.java |  6 +-
 .../paxos/cleanup/PaxosFinishPrepareCleanup.java   |  4 +-
 .../paxos/cleanup/PaxosStartPrepareCleanup.java|  4 +-
 .../cassandra/distributed/impl/Instance.java   | 13 
 .../test/ring/CMSUrgentMessagesTest.java   | 74 ++
 22 files changed, 191 insertions(+), 47 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 12787c4fb3..fb1ae2f8bd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.1
+ * Raise priority of TCM internode messages during critical operations 
(CASSANDRA-19517)
  * Add nodetool command to unregister LEFT nodes (CASSANDRA-19581)
  * Add cluster metadata id to gossip syn messages (CASSANDRA-19613)
  * Reduce heap usage occupied by the metrics (CASSANDRA-19567)
diff --git a/src/java/org/apache/cassandra/net/Message.java 
b/src/java/org/apache/cassandra/net/Message.java
index b0a0b9c48d..7d7799a186 100644
--- a/src/java/org/apache/cassandra/net/Message.java
+++ b/src/java/org/apache/cassandra/net/Message.java
@@ -217,6 +217,15 @@ public class Message
 return outWithParam(nextId(), verb, expiresAtNanos, payload, 0, null, 
null);
 }
 
+public static  Message out(Verb verb, T payload, boolean isUrgent)
+{
+assert !verb.isResponse();
+if (isUrgent)
+return outWithFlag(verb, payload,  MessageFlag.URGENT);
+else
+return out(verb, payload);
+}
+
 public static  Message outWithFlag(Verb verb, T payload, MessageFlag 
flag)
 {
 assert !verb.isResponse();
@@ -305,7 +314,10 @@ public class Message
 /** Builds a response Message with provided payload, and all the right 
fields inferred from request Message */
 public  Message responseWith(T payload)
 {
-return outWithParam(id(), verb().responseVerb, expiresAtNanos(), 
payload, null, null);
+Message msg = outWithParam(id(), verb().responseVerb, 
expiresAtNanos(), payload, null, null);
+if (header.hasFlag(MessageFlag.URGENT))
+msg = msg.withFlag(MessageFlag.URGENT);
+return msg;
 }
 
 /** Builds a response Message with no payload, and all the right fields 
inferred from request Message */
@@ -485,6 +497,11 @@ public class Message
 this.params = params;
 }
 
+public boolean hasFlag(MessageFlag messageFlag)
+{
+return messageFlag.isIn(flags);
+}
+
 Header withFrom(InetAddressAndPort from)
 {
 return new Header(id, epoch, verb, from, createdAtNanos, 
expiresAtNanos, flags, params);
@@ -936,7 +953,7 @@ public class Message
 serializeParams(header.params, out, version);
 }
 
-private Header deserializeHeader(DataInputPlus in, InetAddressAndPort 
peer, int version) throws IOException
+public Header deserializeHeader(DataInputPlus in, InetAddressAndPort 
peer, int version) throws IOException
 {
 long id = in.readUnsignedVInt();
 Epoch epoch = Epoch.EMPTY;
diff --git a/src/java/org/apache/cassandra/net/MessageFlag.java 
b/src/java/org/apache/cassandra/net/MessageFlag.java
index 441b06b6a3..1c2db557c3 100644
--- a/src/java/org/apache/cassandra/net/MessageFlag.java
+++ b/src/java/org/apache/cassandra

(cassandra) branch trunk updated: Merge pre-existing schema with the system defined one during upgrade

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

marcuse 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 4d29a1c75e Merge pre-existing schema with the system defined one 
during upgrade
4d29a1c75e is described below

commit 4d29a1c75e4c7a5493d5601c7a907b75e042c5f9
Author: Marcus Eriksson 
AuthorDate: Thu May 2 09:21:50 2024 +0200

Merge pre-existing schema with the system defined one during upgrade

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19615
---
 .../apache/cassandra/schema/DistributedSchema.java | 28 +-
 .../tcm/transformations/cms/Initialize.java|  6 -
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/java/org/apache/cassandra/schema/DistributedSchema.java 
b/src/java/org/apache/cassandra/schema/DistributedSchema.java
index a837b0773d..3bac327c17 100644
--- a/src/java/org/apache/cassandra/schema/DistributedSchema.java
+++ b/src/java/org/apache/cassandra/schema/DistributedSchema.java
@@ -114,16 +114,32 @@ public class DistributedSchema implements 
MetadataValue
 public static DistributedSchema fromSystemTables(Keyspaces keyspaces, 
Set knownDatacenters)
 {
 if 
(!keyspaces.containsKeyspace(SchemaConstants.METADATA_KEYSPACE_NAME))
-keyspaces = 
keyspaces.withAddedOrReplaced(Keyspaces.of(DistributedMetadataLogKeyspace.initialMetadata(knownDatacenters),
-   
TraceKeyspace.metadata(),
-   
SystemDistributedKeyspace.metadata(),
-   
AuthKeyspace.metadata()));
+{
+Keyspaces kss = 
Keyspaces.of(DistributedMetadataLogKeyspace.initialMetadata(knownDatacenters),
+ TraceKeyspace.metadata(),
+ SystemDistributedKeyspace.metadata(),
+ AuthKeyspace.metadata());
+for (KeyspaceMetadata ksm : keyspaces) // on disk keyspaces
+kss = kss.withAddedOrUpdated(kss.get(ksm.name)
+.map(k -> merged(k, ksm))
+.orElse(ksm));
+keyspaces = kss;
+}
 return new DistributedSchema(keyspaces, Epoch.UPGRADE_GOSSIP);
 }
 
-public void initializeKeyspaceInstances(DistributedSchema prev)
+/**
+ * merges any tables in `mergeFrom` to `mergeTo` unless they already exist 
there.
+ */
+private static KeyspaceMetadata merged(KeyspaceMetadata mergeTo, 
KeyspaceMetadata mergeFrom)
 {
-initializeKeyspaceInstances(prev, true);
+Tables newTables = mergeTo.tables;
+for (TableMetadata metadata : mergeFrom.tables)
+{
+if (!newTables.containsTable(metadata.id))
+newTables = newTables.with(metadata);
+}
+return mergeTo.withSwapped(newTables);
 }
 
 public void initializeKeyspaceInstances(DistributedSchema prev, boolean 
loadSSTables)
diff --git 
a/src/java/org/apache/cassandra/tcm/transformations/cms/Initialize.java 
b/src/java/org/apache/cassandra/tcm/transformations/cms/Initialize.java
index 8103e14f92..11c2ed4d31 100644
--- a/src/java/org/apache/cassandra/tcm/transformations/cms/Initialize.java
+++ b/src/java/org/apache/cassandra/tcm/transformations/cms/Initialize.java
@@ -69,7 +69,11 @@ public class Initialize extends ForceSnapshot
 public Result execute(ClusterMetadata prev)
 {
 ClusterMetadata next = baseState;
-DistributedSchema initialSchema = new 
DistributedSchema(setUpDistributedSystemKeyspaces(next));
+// when upgrading the schema is read from disk and set correctly in 
baseState, but we still need to
+// make sure that lastModified is bumped, otherwise the keyspace 
instances are not created
+DistributedSchema initialSchema = new 
DistributedSchema(next.schema.getKeyspaces().get(SystemDistributedKeyspace.NAME).isEmpty()
+? 
setUpDistributedSystemKeyspaces(next)
+: 
next.schema.getKeyspaces());
 ClusterMetadata.Transformer transformer = 
next.transformer().with(initialSchema);
 return Transformation.success(transformer, 
MetaStrategy.affectedRanges(prev));
 }


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



(cassandra) branch trunk updated: Add nodetool command to unregister LEFT nodes

2024-05-03 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 7694d90152 Add nodetool command to unregister LEFT nodes
7694d90152 is described below

commit 7694d901529e9b78ad3e4c548fbe1c03c305b929
Author: Marcus Eriksson 
AuthorDate: Wed Apr 10 09:18:23 2024 +0200

Add nodetool command to unregister LEFT nodes

Patch by marcuse and Sam Tunnicliffe; reviewed by Sam Tunnicliffe for 
CASSANDRA-19581

Co-authored-by: Sam Tunnicliffe 
Co-authored-by: Marcus Eriksson 
---
 CHANGES.txt|   1 +
 .../db/virtual/ClusterMetadataDirectoryTable.java  | 106 +
 .../cassandra/db/virtual/SystemViewsKeyspace.java  |   1 +
 .../apache/cassandra/service/StorageService.java   |   3 +-
 .../org/apache/cassandra/tcm/CMSOperations.java|  47 +
 .../apache/cassandra/tcm/CMSOperationsMBean.java   |   2 +
 .../cassandra/tcm/transformations/Register.java|   3 +-
 .../cassandra/tcm/transformations/Unregister.java  |  50 --
 src/java/org/apache/cassandra/tools/NodeTool.java  |   3 +-
 .../apache/cassandra/tools/nodetool/CMSAdmin.java  |  12 +++
 .../distributed/test/log/RegisterTest.java |   6 +-
 .../distributed/test/log/UnregisterTest.java   | 100 +++
 12 files changed, 319 insertions(+), 15 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index c8355deda2..12787c4fb3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.1
+ * Add nodetool command to unregister LEFT nodes (CASSANDRA-19581)
  * Add cluster metadata id to gossip syn messages (CASSANDRA-19613)
  * Reduce heap usage occupied by the metrics (CASSANDRA-19567)
  * Improve handling of transient replicas during range movements 
(CASSANDRA-19344)
diff --git 
a/src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java 
b/src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java
new file mode 100644
index 00..0d026ce65d
--- /dev/null
+++ 
b/src/java/org/apache/cassandra/db/virtual/ClusterMetadataDirectoryTable.java
@@ -0,0 +1,106 @@
+/*
+ * 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.db.virtual;
+
+import java.util.Map;
+
+import org.apache.cassandra.db.marshal.InetAddressType;
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.db.marshal.LongType;
+import org.apache.cassandra.db.marshal.UTF8Type;
+import org.apache.cassandra.db.marshal.UUIDType;
+import org.apache.cassandra.dht.LocalPartitioner;
+import org.apache.cassandra.schema.TableMetadata;
+import org.apache.cassandra.tcm.ClusterMetadata;
+import org.apache.cassandra.tcm.membership.Directory;
+import org.apache.cassandra.tcm.membership.Location;
+import org.apache.cassandra.tcm.membership.NodeAddresses;
+import org.apache.cassandra.tcm.membership.NodeId;
+import org.apache.cassandra.tcm.membership.NodeState;
+import org.apache.cassandra.tcm.membership.NodeVersion;
+
+
+final class ClusterMetadataDirectoryTable extends AbstractVirtualTable
+{
+private static final String NODE_ID = "node_id";
+private static final String HOST_ID = "host_id";
+private static final String STATE = "state";
+private static final String CASSANDRA_VERSION = "cassandra_version";
+private static final String SERIALIZATION_VERSION = 
"serialization_version";
+private static final String RACK = "rack";
+private static final String DC = "dc";
+private static final String BROADCAST_ADDRESS = "broadcast_address";
+private static final String BROADCAST_PORT = "broadcast_port";
+private static final String LOCAL_ADDRESS = "local_address";
+private static final String LOCAL_PORT = "local_port";
+private static final String NATIVE_ADDRESS = "native_address";
+private static final String NATIVE_PORT = "native_port";
+
+
+ClusterMetadataDirectoryTable(String keyspace

(cassandra) branch trunk updated: Remove leftover period column from system.metadata_snapshots

2024-04-25 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 b7eafa94f3 Remove leftover period column from system.metadata_snapshots
b7eafa94f3 is described below

commit b7eafa94f3b4f5361e891fde5c8a24d089b52d4c
Author: Marcus Eriksson 
AuthorDate: Wed Apr 24 16:27:10 2024 +0200

Remove leftover period column from system.metadata_snapshots

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19587
---
 src/java/org/apache/cassandra/db/SystemKeyspace.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/db/SystemKeyspace.java 
b/src/java/org/apache/cassandra/db/SystemKeyspace.java
index e7840a29e3..d8ee15b6b2 100644
--- a/src/java/org/apache/cassandra/db/SystemKeyspace.java
+++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java
@@ -500,7 +500,6 @@ public final class SystemKeyspace
 "ClusterMetadata 
snapshots",
 "CREATE TABLE IF NOT 
EXISTS %s (" +
 "epoch bigint PRIMARY 
KEY," +
-"period bigint," +
 "snapshot blob)")
   
.partitioner(MetaStrategy.partitioner)
   .build();


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



(cassandra) branch trunk updated: ForceSnapshot transformations should not be persisted in the local log table

2024-04-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 17ecece543 ForceSnapshot transformations should not be persisted in 
the local log table
17ecece543 is described below

commit 17ecece5437ab39aaeaa0eb4b42434cddd9960b5
Author: Sam Tunnicliffe 
AuthorDate: Thu Dec 14 17:55:05 2023 +

ForceSnapshot transformations should not be persisted in the local log table

Patch by Sam Tunnicliffe; reviewed by marcuse for CASSANDRA-19190
---
 .../apache/cassandra/schema/DistributedSchema.java |  11 +-
 .../org/apache/cassandra/tcm/ClusterMetadata.java  |   2 +-
 .../cassandra/tcm/StubClusterMetadataService.java  |  83 -
 .../tcm/listeners/MetadataSnapshotListener.java|  10 +-
 .../org/apache/cassandra/tcm/log/LocalLog.java |   6 +-
 .../test/log/ClusterMetadataTestHelper.java|  19 ++-
 .../listeners/MetadataSnapshotListenerTest.java| 133 +
 .../org/apache/cassandra/tcm/log/LocalLogTest.java |  54 +
 8 files changed, 310 insertions(+), 8 deletions(-)

diff --git a/src/java/org/apache/cassandra/schema/DistributedSchema.java 
b/src/java/org/apache/cassandra/schema/DistributedSchema.java
index 86dd1d5117..a837b0773d 100644
--- a/src/java/org/apache/cassandra/schema/DistributedSchema.java
+++ b/src/java/org/apache/cassandra/schema/DistributedSchema.java
@@ -58,9 +58,16 @@ public class DistributedSchema implements 
MetadataValue
 return new DistributedSchema(Keyspaces.none(), Epoch.EMPTY);
 }
 
-public static DistributedSchema first()
+public static DistributedSchema first(Set knownDatacenters)
 {
-return new 
DistributedSchema(Keyspaces.of(DistributedMetadataLogKeyspace.initialMetadata(Collections.singleton(DatabaseDescriptor.getLocalDataCenter(,
 Epoch.FIRST);
+if (knownDatacenters.isEmpty())
+{
+if (DatabaseDescriptor.getLocalDataCenter() != null)
+knownDatacenters = 
Collections.singleton(DatabaseDescriptor.getLocalDataCenter());
+else
+knownDatacenters = Collections.singleton("DC1");
+}
+return new 
DistributedSchema(Keyspaces.of(DistributedMetadataLogKeyspace.initialMetadata(knownDatacenters)),
 Epoch.FIRST);
 }
 
 private final Keyspaces keyspaces;
diff --git a/src/java/org/apache/cassandra/tcm/ClusterMetadata.java 
b/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
index 33886bec40..fdf4942c13 100644
--- a/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
+++ b/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
@@ -107,7 +107,7 @@ public class ClusterMetadata
 @VisibleForTesting
 public ClusterMetadata(IPartitioner partitioner, Directory directory)
 {
-this(partitioner, directory, DistributedSchema.first());
+this(partitioner, directory, 
DistributedSchema.first(directory.knownDatacenters()));
 }
 
 @VisibleForTesting
diff --git a/src/java/org/apache/cassandra/tcm/StubClusterMetadataService.java 
b/src/java/org/apache/cassandra/tcm/StubClusterMetadataService.java
index 475e8ef21b..8e191307d1 100644
--- a/src/java/org/apache/cassandra/tcm/StubClusterMetadataService.java
+++ b/src/java/org/apache/cassandra/tcm/StubClusterMetadataService.java
@@ -20,15 +20,24 @@ package org.apache.cassandra.tcm;
 
 import java.util.Collections;
 
+import com.google.common.collect.ImmutableMap;
+
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.schema.DistributedMetadataLogKeyspace;
 import org.apache.cassandra.schema.DistributedSchema;
 import org.apache.cassandra.schema.KeyspaceMetadata;
 import org.apache.cassandra.schema.Keyspaces;
+import org.apache.cassandra.tcm.Commit.Replicator;
 import org.apache.cassandra.tcm.log.Entry;
 import org.apache.cassandra.tcm.log.LocalLog;
 import org.apache.cassandra.tcm.membership.Directory;
+import org.apache.cassandra.tcm.ownership.DataPlacements;
+import org.apache.cassandra.tcm.ownership.PlacementProvider;
+import org.apache.cassandra.tcm.ownership.TokenMap;
 import org.apache.cassandra.tcm.ownership.UniformRangePlacement;
+import org.apache.cassandra.tcm.sequences.InProgressSequences;
+import org.apache.cassandra.tcm.sequences.LockedRanges;
 
 public class StubClusterMetadataService extends ClusterMetadataService
 {
@@ -73,12 +82,24 @@ public class StubClusterMetadataService extends 
ClusterMetadataService
   .withInitialState(initial)
   .createLog(),
   new StubProcessor(),
-  Commit.Replicator.NO_OP,
+  Replicator.NO_OP,
   false);
 this.metadata = initial;
 this.log().readyUnchecked();
 }
 
+private StubClusterMetadataService(Placeme

(cassandra) branch trunk updated: Optimisations to PlacementForRange, improve lookup on r/w path

2024-04-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 34d999c47a Optimisations to PlacementForRange, improve lookup on r/w 
path
34d999c47a is described below

commit 34d999c47a4da6d43a67910354fb9888184b23ab
Author: Marcus Eriksson 
AuthorDate: Wed Mar 20 15:53:50 2024 +0100

Optimisations to PlacementForRange, improve lookup on r/w path

Patch by marcuse and Sam Tunnicliffe; reviewed by Sam Tunnicliffe for 
CASSANDRA-19191

Co-authored-by: Sam Tunnicliffe 
Co-authored-by: Marcus Eriksson 
---
 .../apache/cassandra/locator/LocalStrategy.java|   6 +-
 .../cassandra/locator/NetworkTopologyStrategy.java |   6 +-
 .../apache/cassandra/locator/SimpleStrategy.java   |   6 +-
 .../org/apache/cassandra/tcm/ClusterMetadata.java  |  16 +-
 .../cassandra/tcm/ownership/DataPlacement.java |  68 +++
 .../cassandra/tcm/ownership/DataPlacements.java|  14 +-
 .../{PlacementForRange.java => ReplicaGroups.java} | 206 +
 .../org/apache/cassandra/tcm/sequences/Move.java   |   4 +-
 .../cassandra/tcm/sequences/RemoveNodeStreams.java |   4 +-
 .../cassandra/distributed/shared/ClusterUtils.java |   4 +-
 .../test/log/MetadataChangeSimulationTest.java |  26 +--
 .../test/log/OperationalEquivalenceTest.java   |   4 +-
 .../distributed/test/log/SimulatedOperation.java   |   4 +-
 .../distributed/test/ring/RangeVersioningTest.java |   4 +-
 .../test/microbench/ReplicaGroupsBench.java| 138 ++
 .../tcm/compatibility/GossipHelperTest.java|   6 +-
 .../tcm/ownership/UniformRangePlacementTest.java   |  68 ---
 .../InProgressSequenceCancellationTest.java|  18 +-
 .../cassandra/tcm/sequences/SequencesUtils.java|   2 +-
 19 files changed, 392 insertions(+), 212 deletions(-)

diff --git a/src/java/org/apache/cassandra/locator/LocalStrategy.java 
b/src/java/org/apache/cassandra/locator/LocalStrategy.java
index 69193090c4..4032ce1594 100644
--- a/src/java/org/apache/cassandra/locator/LocalStrategy.java
+++ b/src/java/org/apache/cassandra/locator/LocalStrategy.java
@@ -26,7 +26,7 @@ import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.tcm.ClusterMetadata;
 import org.apache.cassandra.tcm.Epoch;
 import org.apache.cassandra.tcm.ownership.DataPlacement;
-import org.apache.cassandra.tcm.ownership.PlacementForRange;
+import org.apache.cassandra.tcm.ownership.ReplicaGroups;
 import org.apache.cassandra.tcm.ownership.VersionedEndpoints;
 import org.apache.cassandra.utils.FBUtilities;
 
@@ -65,7 +65,7 @@ public class LocalStrategy extends SystemStrategy
 {
 public static final Range entireRange = new 
Range<>(DatabaseDescriptor.getPartitioner().getMinimumToken(), 
DatabaseDescriptor.getPartitioner().getMinimumToken());
 public static final EndpointsForRange localReplicas = 
EndpointsForRange.of(new Replica(FBUtilities.getBroadcastAddressAndPort(), 
entireRange, true));
-public static final DataPlacement placement = new 
DataPlacement(PlacementForRange.builder().withReplicaGroup(VersionedEndpoints.forRange(Epoch.FIRST,
 localReplicas)).build(),
-
PlacementForRange.builder().withReplicaGroup(VersionedEndpoints.forRange(Epoch.FIRST,
 localReplicas)).build());
+public static final DataPlacement placement = new 
DataPlacement(ReplicaGroups.builder().withReplicaGroup(VersionedEndpoints.forRange(Epoch.FIRST,
 localReplicas)).build(),
+
ReplicaGroups.builder().withReplicaGroup(VersionedEndpoints.forRange(Epoch.FIRST,
 localReplicas)).build());
 }
 }
diff --git a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java 
b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
index d48ee31610..05bfcfb9ed 100644
--- a/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
+++ b/src/java/org/apache/cassandra/locator/NetworkTopologyStrategy.java
@@ -49,7 +49,7 @@ import org.apache.cassandra.tcm.membership.Directory;
 import org.apache.cassandra.tcm.membership.Location;
 import org.apache.cassandra.tcm.membership.NodeId;
 import org.apache.cassandra.tcm.ownership.DataPlacement;
-import org.apache.cassandra.tcm.ownership.PlacementForRange;
+import org.apache.cassandra.tcm.ownership.ReplicaGroups;
 import org.apache.cassandra.tcm.ownership.TokenMap;
 import org.apache.cassandra.tcm.ownership.VersionedEndpoints;
 import org.apache.cassandra.utils.FBUtilities;
@@ -194,7 +194,7 @@ public class NetworkTopologyStrategy extends 
AbstractReplicationStrategy
  Directory directory,
  TokenMap tokenMap)
 {
-PlacementForRang

(cassandra) branch trunk updated: Update use of transition plan in PrepareReplace

2024-04-21 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 c5c4cd4e57 Update use of transition plan in PrepareReplace
c5c4cd4e57 is described below

commit c5c4cd4e57515785d91ebaa918d533baf315
Author: Marcus Eriksson 
AuthorDate: Tue Apr 2 15:54:04 2024 +0200

Update use of transition plan in PrepareReplace

Patch by Sam Tunnicliffe and marcuse; reviewed by Sam Tunnicliffe for 
CASSANDRA-19132
---
 .../tcm/ownership/PlacementTransitionPlan.java | 12 
 .../cassandra/tcm/transformations/PrepareJoin.java |  2 +-
 .../tcm/transformations/PrepareLeave.java  |  2 +-
 .../cassandra/tcm/transformations/PrepareMove.java |  2 +-
 .../tcm/transformations/PrepareReplace.java| 33 --
 .../tcm/ownership/PlacementTransitionPlanTest.java | 30 
 6 files changed, 33 insertions(+), 48 deletions(-)

diff --git 
a/src/java/org/apache/cassandra/tcm/ownership/PlacementTransitionPlan.java 
b/src/java/org/apache/cassandra/tcm/ownership/PlacementTransitionPlan.java
index 1d95df4122..c93d33f632 100644
--- a/src/java/org/apache/cassandra/tcm/ownership/PlacementTransitionPlan.java
+++ b/src/java/org/apache/cassandra/tcm/ownership/PlacementTransitionPlan.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.Set;
 import javax.annotation.Nullable;
 
+import com.google.common.annotations.VisibleForTesting;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -159,17 +160,14 @@ public class PlacementTransitionPlan
  * @return null if everything is good, otherwise a Transformation.Result 
rejection containing information about the bad replica
  */
 @Nullable
-public static void assertPreExistingWriteReplica(DataPlacements 
placements, PlacementTransitionPlan transitionPlan)
+public void assertPreExistingWriteReplica(DataPlacements placements)
 {
-assertPreExistingWriteReplica(placements,
-  transitionPlan.toSplit,
-  transitionPlan.addToWrites(),
-  transitionPlan.moveReads(),
-  transitionPlan.removeFromWrites());
+assertPreExistingWriteReplica(placements, toSplit, addToWrites(), 
moveReads(), removeFromWrites());
 }
 
 @Nullable
-public static void assertPreExistingWriteReplica(DataPlacements 
placements, PlacementDeltas ... deltasInOrder)
+@VisibleForTesting
+protected void assertPreExistingWriteReplica(DataPlacements placements, 
PlacementDeltas... deltasInOrder)
 {
 for (PlacementDeltas deltas : deltasInOrder)
 {
diff --git a/src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java 
b/src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java
index a684e76d50..6a518975b4 100644
--- a/src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java
+++ b/src/java/org/apache/cassandra/tcm/transformations/PrepareJoin.java
@@ -167,7 +167,7 @@ public class PrepareJoin implements Transformation
 
 void assertPreExistingWriteReplica(DataPlacements placements, 
PlacementTransitionPlan transitionPlan)
 {
-PlacementTransitionPlan.assertPreExistingWriteReplica(placements, 
transitionPlan);
+transitionPlan.assertPreExistingWriteReplica(placements);
 }
 
 public static abstract class Serializer implements 
AsymmetricMetadataSerializer
diff --git 
a/src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java 
b/src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java
index e8512b1ce9..0ad37f8bcd 100644
--- a/src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java
+++ b/src/java/org/apache/cassandra/tcm/transformations/PrepareLeave.java
@@ -115,7 +115,7 @@ public class PrepareLeave implements Transformation
 PlacementDeltas startDelta = transitionPlan.addToWrites();
 PlacementDeltas midDelta = transitionPlan.moveReads();
 PlacementDeltas finishDelta = transitionPlan.removeFromWrites();
-PlacementTransitionPlan.assertPreExistingWriteReplica(prev.placements, 
transitionPlan);
+transitionPlan.assertPreExistingWriteReplica(prev.placements);
 
 LockedRanges.Key unlockKey = LockedRanges.keyFor(proposed.epoch);
 
diff --git a/src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java 
b/src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java
index 42d276b816..e7e278d0d2 100644
--- a/src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java
+++ b/src/java/org/apache/cassandra/tcm/transformations/PrepareMove.java
@@ -109,7 +109,7 @@ public class PrepareMove implements Transformation
 StartMove startMove = new StartMove(nodeId, 
transitionPlan.addToWrites(), lockKey

(cassandra) branch trunk updated: Use Transformation.Kind.id in local and distributed log tables

2024-04-12 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 d548396597 Use Transformation.Kind.id in local and distributed log 
tables
d548396597 is described below

commit d548396597897012c0b8ed83264f8dd911fb84bf
Author: Marcus Eriksson 
AuthorDate: Wed Apr 3 09:58:49 2024 +0200

Use Transformation.Kind.id in local and distributed log tables

Patch by Sam Tunnicliffe and marcuse; reviewed by Sam Tunnicliffe for 
CASSANDRA-19516

Co-authored-by: Sam Tunnicliffe 
Co-authored-by: Marcus Eriksson 
---
 CHANGES.txt|  1 +
 .../cql3/functions/ClusterMetadataFcts.java| 57 ++
 .../cassandra/cql3/functions/NativeFunctions.java  |  1 +
 .../org/apache/cassandra/db/SystemKeyspace.java|  2 +-
 .../db/virtual/ClusterMetadataLogTable.java|  2 +-
 .../schema/DistributedMetadataLogKeyspace.java | 10 ++--
 .../org/apache/cassandra/tcm/Transformation.java   |  2 +-
 .../cassandra/tcm/log/SystemKeyspaceStorage.java   |  4 +-
 .../cql3/functions/ClusterMetadataFctsTest.java| 68 ++
 9 files changed, 137 insertions(+), 10 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index c313028dad..cfbbc651ef 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.1
+ * Use Transformation.Kind.id in local and distributed log tables 
(CASSANDRA-19516)
  * Remove period field from ClusterMetadata and metadata log tables 
(CASSANDRA-19482)
  * Enrich system_views.pending_hints vtable with hints sizes (CASSANDRA-19486)
  * Expose all dropwizard metrics in virtual tables (CASSANDRA-14572)
diff --git 
a/src/java/org/apache/cassandra/cql3/functions/ClusterMetadataFcts.java 
b/src/java/org/apache/cassandra/cql3/functions/ClusterMetadataFcts.java
new file mode 100644
index 00..5c209aaa5e
--- /dev/null
+++ b/src/java/org/apache/cassandra/cql3/functions/ClusterMetadataFcts.java
@@ -0,0 +1,57 @@
+/*
+ * 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.functions;
+
+import java.nio.ByteBuffer;
+
+import org.apache.cassandra.db.marshal.Int32Type;
+import org.apache.cassandra.db.marshal.UTF8Type;
+import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.tcm.Transformation;
+import org.apache.cassandra.utils.ByteBufferUtil;
+
+public class ClusterMetadataFcts
+{
+public static void addFunctionsTo(NativeFunctions functions)
+{
+functions.add(transformationKind);
+}
+
+public static final NativeScalarFunction transformationKind = new 
TransformationKind();
+private static final class TransformationKind extends NativeScalarFunction
+{
+
+private TransformationKind()
+{
+super("transformation_kind", UTF8Type.instance, 
Int32Type.instance);
+}
+
+@Override
+public ByteBuffer execute(Arguments arguments) throws 
InvalidRequestException
+{
+Number id = arguments.get(0);
+if (id.intValue() < 0 || id.intValue() > 
Transformation.Kind.values().length -1)
+throw new InvalidRequestException(id + " is not a valid 
Transformation.Kind id");
+
+Transformation.Kind kind = 
Transformation.Kind.fromId(id.intValue());
+return ByteBufferUtil.bytes(kind.name());
+
+}
+}
+}
diff --git a/src/java/org/apache/cassandra/cql3/functions/NativeFunctions.java 
b/src/java/org/apache/cassandra/cql3/functions/NativeFunctions.java
index 2100fe3f89..a9deba5cb1 100644
--- a/src/java/org/apache/cassandra/cql3/functions/NativeFunctions.java
+++ b/src/java/org/apache/cassandra/cql3/functions/NativeFunctions.java
@@ -47,6 +47,7 @@ public class NativeFunctions
 MathFcts.addFunctionsTo(this);
 MaskingFcts.addFunctionsTo(this);
 VectorFcts.addFunctionsTo(this);
+ClusterMetadataFcts.addFunctionsTo(this);
 }
 };
 
diff --git a/src/java/org/apache/cassandra/db/SystemKey

(cassandra) branch trunk updated: Override the correct method to avoid retries in ConsistentBootstrapTest.coordinatorIsBehindTest

2024-03-25 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 8d8c6fbc37 Override the correct method to avoid retries in 
ConsistentBootstrapTest.coordinatorIsBehindTest
8d8c6fbc37 is described below

commit 8d8c6fbc37899ff77be6b3431f99f6951c4c05c2
Author: Marcus Eriksson 
AuthorDate: Fri Mar 22 13:39:34 2024 +0100

Override the correct method to avoid retries in 
ConsistentBootstrapTest.coordinatorIsBehindTest

Patch by marcuse; reviewed by Alex Petrov for CASSANDRA-19343
---
 .../org/apache/cassandra/fuzz/ring/ConsistentBootstrapTest.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/fuzz/ring/ConsistentBootstrapTest.java 
b/test/distributed/org/apache/cassandra/fuzz/ring/ConsistentBootstrapTest.java
index c03047478f..592d88be51 100644
--- 
a/test/distributed/org/apache/cassandra/fuzz/ring/ConsistentBootstrapTest.java
+++ 
b/test/distributed/org/apache/cassandra/fuzz/ring/ConsistentBootstrapTest.java
@@ -127,11 +127,11 @@ public class ConsistentBootstrapTest extends FuzzTestBase
 
 ReplayingHistoryBuilder harry = HarryHelper.dataGen(new 
InJvmSut(cluster, () -> 2, (t) -> false)
 {
-public 
Object[][] execute(String statement, ConsistencyLevel cl, int coordinator, 
Object... bindings)
+public 
Object[][] execute(String statement, ConsistencyLevel cl, int coordinator, int 
pagesize, Object... bindings)
 {
 try
 {
-
return super.execute(statement, cl, coordinator, bindings);
+
return super.execute(statement, cl, coordinator, pagesize, bindings);
 }
 catch 
(Throwable t)
 {


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



(cassandra) branch trunk updated: Reimplement ClusterMetadata::writePlacementAllSettled to step through InProgressSequences to determine state when finished.

2024-03-25 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 63c6261856 Reimplement ClusterMetadata::writePlacementAllSettled to 
step through InProgressSequences to determine state when finished.
63c6261856 is described below

commit 63c62618560ad65b5b3e9f4d34b70b8b6dd0a75b
Author: Marcus Eriksson 
AuthorDate: Tue Mar 12 08:31:05 2024 +0100

Reimplement ClusterMetadata::writePlacementAllSettled to step through 
InProgressSequences to determine state when finished.

Patch by marcuse; reviewed by Alex Petrov for CASSANDRA-19193
---
 .../org/apache/cassandra/tcm/ClusterMetadata.java  | 46 +++--
 .../apache/cassandra/tcm/MultiStepOperation.java   | 34 +
 .../apache/cassandra/tcm/sequences/AddToCMS.java   |  6 +++
 .../cassandra/tcm/sequences/BootstrapAndJoin.java  |  7 +++
 .../tcm/sequences/BootstrapAndReplace.java |  7 +++
 .../tcm/sequences/InProgressSequences.java | 13 +++--
 .../org/apache/cassandra/tcm/sequences/Move.java   | 10 +++-
 .../cassandra/tcm/sequences/ReconfigureCMS.java| 21 
 .../tcm/sequences/UnbootstrapAndLeave.java |  7 +++
 .../cassandra/tcm/transformations/UnsafeJoin.java  | 32 ++--
 .../test/log/MetadataChangeSimulationTest.java | 58 +-
 .../apache/cassandra/tcm/ClusterMetadataTest.java  |  2 +-
 12 files changed, 170 insertions(+), 73 deletions(-)

diff --git a/src/java/org/apache/cassandra/tcm/ClusterMetadata.java 
b/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
index 5e6b9a6060..3224b29466 100644
--- a/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
+++ b/src/java/org/apache/cassandra/tcm/ClusterMetadata.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -64,7 +65,6 @@ import 
org.apache.cassandra.tcm.ownership.PrimaryRangeComparator;
 import org.apache.cassandra.tcm.ownership.PlacementForRange;
 import org.apache.cassandra.tcm.ownership.TokenMap;
 import org.apache.cassandra.tcm.ownership.VersionedEndpoints;
-import org.apache.cassandra.tcm.sequences.BootstrapAndJoin;
 import org.apache.cassandra.tcm.sequences.InProgressSequences;
 import org.apache.cassandra.tcm.sequences.LockedRanges;
 import org.apache.cassandra.tcm.serialization.MetadataSerializer;
@@ -309,45 +309,15 @@ public class ClusterMetadata
 
 public DataPlacement writePlacementAllSettled(KeyspaceMetadata ksm)
 {
-List joining = new ArrayList<>();
-List leaving = new ArrayList<>();
-List moving = new ArrayList<>();
-
-for (Map.Entry entry : directory.states.entrySet())
-{
-switch (entry.getValue())
-{
-case BOOTSTRAPPING:
-joining.add(entry.getKey());
-break;
-case LEAVING:
-leaving.add(entry.getKey());
-break;
-case MOVING:
-moving.add(entry.getKey());
-break;
-}
-}
-
-Transformer t = transformer();
-for (NodeId node: joining)
+ClusterMetadata metadata = this;
+Iterator> iter = 
metadata.inProgressSequences.iterator();
+while (iter.hasNext())
 {
-MultiStepOperation joinSequence = inProgressSequences.get(node);
-assert joinSequence instanceof BootstrapAndJoin;
-Set tokens = 
((BootstrapAndJoin)joinSequence).finishJoin.tokens;
-t = t.proposeToken(node, tokens);
+Transformation.Result result = iter.next().applyTo(metadata);
+assert result.isSuccess();
+metadata = result.success().metadata;
 }
-for (NodeId node : leaving)
-t = t.proposeRemoveNode(node);
-// todo: add tests for move!
-for (NodeId node : moving)
-t = t.proposeRemoveNode(node).proposeToken(node, 
tokenMap.tokens(node));
-
-ClusterMetadata proposed = t.build().metadata;
-return ClusterMetadataService.instance()
- .placementProvider()
- .calculatePlacements(epoch, 
proposed.tokenMap.toRanges(), proposed, Keyspaces.of(ksm))
- .get(ksm.params.replication);
+return metadata.placements.get(ksm.params.replication);
 }
 
 // TODO Remove this as it isn't really an equivalent to the previous 
concept of pending ranges
diff --git a/src/java/org/apache/cassandra/tcm/MultiStepOperation.java 
b/src/java/org/apache/cassandra/tcm/MultiStepOperation.java
index b315aa9b42..9e8f21c6ec 

(cassandra) branch trunk updated: Preclude irrecoverable log corruption in case split-brain situation during leader election with absent seeds

2024-03-25 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 0ec5ef2c70 Preclude irrecoverable log corruption in case split-brain 
situation during leader election with absent seeds
0ec5ef2c70 is described below

commit 0ec5ef2c7035fc93323816140994617a9d953956
Author: Alex Petrov 
AuthorDate: Wed Mar 6 07:58:18 2024 +0100

Preclude irrecoverable log corruption in case split-brain situation during 
leader election with absent seeds

Patch by Alex Petrov; reviewed my marcuse for CASSANDRA-19153
---
 src/java/org/apache/cassandra/config/Config.java   |   1 +
 .../cassandra/config/DatabaseDescriptor.java   |   5 +
 .../net/CMSIdentifierMismatchException.java|  32 +++
 .../cassandra/net/InboundMessageHandler.java   |  16 
 .../org/apache/cassandra/net/MessageDelivery.java  |   7 +-
 .../org/apache/cassandra/tcm/ClusterMetadata.java  | 104 +++--
 src/java/org/apache/cassandra/tcm/Commit.java  |  19 +++-
 src/java/org/apache/cassandra/tcm/Discovery.java   |  33 +--
 src/java/org/apache/cassandra/tcm/Startup.java |   9 +-
 .../org/apache/cassandra/tcm/log/LogState.java |  10 +-
 .../tcm/migration/ClusterMetadataHolder.java   |   4 +-
 .../tcm/serialization/MessageSerializers.java  |   5 +
 .../cassandra/distributed/impl/InstanceConfig.java |   1 +
 .../distributed/test/log/RegisterTest.java |   1 -
 .../distributed/test/tcm/SplitBrainTest.java   |  79 
 15 files changed, 300 insertions(+), 26 deletions(-)

diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index 1b2ea89512..75bbdd73c8 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -1296,5 +1296,6 @@ public class Config
 
 public volatile DurationSpec.LongMillisecondsBound 
progress_barrier_timeout = new DurationSpec.LongMillisecondsBound("360ms");
 public volatile DurationSpec.LongMillisecondsBound 
progress_barrier_backoff = new DurationSpec.LongMillisecondsBound("1000ms");
+public volatile DurationSpec.LongSecondsBound discovery_timeout = new 
DurationSpec.LongSecondsBound("30s");
 public boolean unsafe_tcm_mode = false;
 }
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 39ddbe5046..59f4040203 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -5134,6 +5134,11 @@ public class DatabaseDescriptor
 conf.progress_barrier_backoff = new 
DurationSpec.LongMillisecondsBound(timeOutInMillis);
 }
 
+public static long getDiscoveryTimeout(TimeUnit unit)
+{
+return conf.discovery_timeout.to(unit);
+}
+
 public static boolean getUnsafeTCMMode()
 {
 return conf.unsafe_tcm_mode;
diff --git 
a/src/java/org/apache/cassandra/net/CMSIdentifierMismatchException.java 
b/src/java/org/apache/cassandra/net/CMSIdentifierMismatchException.java
new file mode 100644
index 00..6f525b1a90
--- /dev/null
+++ b/src/java/org/apache/cassandra/net/CMSIdentifierMismatchException.java
@@ -0,0 +1,32 @@
+/*
+ * 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.net;
+
+/**
+ * Exception thrown in case of a CMS identifier mismatch. This should usually 
not happen, except rare cases of
+ * network partition during CMS election during initial cluster bringup. This 
is just a precaution to avoid
+ * corrupting CMS log.
+ */
+public class CMSIdentifierMismatchException extends RuntimeException
+{
+public CMSIdentifierMismatchException(String format)
+{
+super(format);
+}
+}
diff --git a/src/java/org/apache/cassandra/net/InboundMessageHandler.java 
b/src/java/org/apache/cassandra/net/InboundMessageHandler.java
index ce75b67656..746c0f7a39 100644
--- a/src/java/org/apache/

(cassandra) branch trunk updated: Avoid exposing intermediate state while replaying log during startup

2024-03-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 5d4bcc797a Avoid exposing intermediate state while replaying log 
during startup
5d4bcc797a is described below

commit 5d4bcc797af882c64736b3f842cbf8bedbba184b
Author: Marcus Eriksson 
AuthorDate: Thu Feb 1 10:16:41 2024 +0100

Avoid exposing intermediate state while replaying log during startup

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19384
---
 .../cassandra/cql3/functions/FunctionCall.java |  7 +++---
 .../cassandra/cql3/functions/FunctionResolver.java | 24 --
 .../cql3/functions/masking/ColumnMask.java | 11 
 .../cql3/selection/AbstractFunctionSelector.java   |  3 ++-
 .../cassandra/cql3/selection/Selectable.java   |  6 ++---
 .../statements/schema/AlterTableStatement.java | 29 ++
 .../statements/schema/CreateTableStatement.java| 22 
 .../cassandra/io/sstable/CQLSSTableWriter.java |  6 ++---
 .../org/apache/cassandra/schema/UserFunctions.java | 17 +
 .../apache/cassandra/service/StorageService.java   |  4 +--
 src/java/org/apache/cassandra/tcm/Startup.java |  8 --
 .../org/apache/cassandra/tcm/Transformation.java   |  2 +-
 .../org/apache/cassandra/tcm/log/LocalLog.java | 14 ++-
 .../org/apache/cassandra/tcm/log/LogState.java | 13 ++
 test/unit/org/apache/cassandra/cql3/CQLTester.java |  1 +
 .../cql3/functions/NativeFunctionsTest.java|  4 ++-
 .../cql3/functions/masking/ColumnMaskTester.java   |  3 +--
 .../db/ColumnFamilyStoreClientModeTest.java|  3 ++-
 .../io/sstable/StressCQLSSTableWriter.java |  2 +-
 19 files changed, 103 insertions(+), 76 deletions(-)

diff --git a/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java 
b/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
index 30d9d50437..c45964a997 100644
--- a/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FunctionCall.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.cql3.terms.Term;
 import org.apache.cassandra.cql3.terms.Terms;
 import org.apache.cassandra.db.marshal.*;
 import org.apache.cassandra.exceptions.InvalidRequestException;
+import org.apache.cassandra.schema.UserFunctions;
 import org.apache.cassandra.serializers.MarshalException;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -150,7 +151,7 @@ public class FunctionCall extends Term.NonTerminal
 
 public Term prepare(String keyspace, ColumnSpecification receiver) 
throws InvalidRequestException
 {
-Function fun = FunctionResolver.get(keyspace, name, terms, 
receiver.ksName, receiver.cfName, receiver.type);
+Function fun = FunctionResolver.get(keyspace, name, terms, 
receiver.ksName, receiver.cfName, receiver.type, 
UserFunctions.getCurrentUserFunctions(name, keyspace));
 if (fun == null)
 throw invalidRequest("Unknown function %s called", name);
 if (fun.isAggregate())
@@ -194,7 +195,7 @@ public class FunctionCall extends Term.NonTerminal
 // later with a more helpful error message that if we were to 
return false here.
 try
 {
-Function fun = FunctionResolver.get(keyspace, name, terms, 
receiver.ksName, receiver.cfName, receiver.type);
+Function fun = FunctionResolver.get(keyspace, name, terms, 
receiver.ksName, receiver.cfName, receiver.type, 
UserFunctions.getCurrentUserFunctions(name, keyspace));
 
 // Because the return type of functions built by factories is 
not fixed but depending on the types of
 // their arguments, we'll always get EXACT_MATCH.  To handle 
potentially ambiguous function calls with
@@ -221,7 +222,7 @@ public class FunctionCall extends Term.NonTerminal
 {
 try
 {
-Function fun = FunctionResolver.get(keyspace, name, terms, 
null, null, null);
+Function fun = FunctionResolver.get(keyspace, name, terms, 
null, null, null, UserFunctions.getCurrentUserFunctions(name, keyspace));
 return fun == null ? null : fun.returnType();
 }
 catch (InvalidRequestException e)
diff --git a/src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java 
b/src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java
index fd1c901b59..11cf24362c 100644
--- a/src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java
+++ b/src/java/org/apache/cassandra/cql3/functions/FunctionResolver.java
@@ -29,7 +29,6 @@ import org.apache.cassandra.cql3.terms.Marker;
 import org.apache.cassandra.cql3.AssignmentTestable;
 import org.apache.cass

(cassandra) 02/03: Add an explicit id to Transformation.Kind

2024-03-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 0e5fb78c018245e1dfb25317d695665cb3317f3e
Author: Marcus Eriksson 
AuthorDate: Mon Feb 12 12:57:30 2024 +0100

Add an explicit id to Transformation.Kind

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19390
---
 .../org/apache/cassandra/tcm/Transformation.java   | 111 +
 1 file changed, 67 insertions(+), 44 deletions(-)

diff --git a/src/java/org/apache/cassandra/tcm/Transformation.java 
b/src/java/org/apache/cassandra/tcm/Transformation.java
index df15598b4d..943450aa53 100644
--- a/src/java/org/apache/cassandra/tcm/Transformation.java
+++ b/src/java/org/apache/cassandra/tcm/Transformation.java
@@ -20,6 +20,8 @@ package org.apache.cassandra.tcm;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.Comparator;
 import java.util.function.Supplier;
 
 import com.google.common.collect.ImmutableSet;
@@ -165,60 +167,81 @@ public interface Transformation
 
 enum Kind
 {
-PRE_INITIALIZE_CMS(() -> PreInitialize.serializer),
-INITIALIZE_CMS(() -> Initialize.serializer),
-FORCE_SNAPSHOT(() -> ForceSnapshot.serializer),
-SEAL_PERIOD(() -> SealPeriod.serializer),
-SCHEMA_CHANGE(() -> AlterSchema.serializer),
-REGISTER(() -> Register.serializer),
-UNREGISTER(() -> Unregister.serializer),
-
-UNSAFE_JOIN(() -> UnsafeJoin.serializer),
-PREPARE_JOIN(() -> PrepareJoin.serializer),
-START_JOIN(() -> PrepareJoin.StartJoin.serializer),
-MID_JOIN(() -> PrepareJoin.MidJoin.serializer),
-FINISH_JOIN(() -> PrepareJoin.FinishJoin.serializer),
-
-PREPARE_MOVE(() -> PrepareMove.serializer),
-START_MOVE(() -> PrepareMove.StartMove.serializer),
-MID_MOVE(() -> PrepareMove.MidMove.serializer),
-FINISH_MOVE(() -> PrepareMove.FinishMove.serializer),
-
-PREPARE_LEAVE(() -> PrepareLeave.serializer),
-START_LEAVE(() -> PrepareLeave.StartLeave.serializer),
-MID_LEAVE(() -> PrepareLeave.MidLeave.serializer),
-FINISH_LEAVE(() -> PrepareLeave.FinishLeave.serializer),
-ASSASSINATE(() -> Assassinate.serializer),
-
-PREPARE_REPLACE(() -> PrepareReplace.serializer),
-START_REPLACE(() -> PrepareReplace.StartReplace.serializer),
-MID_REPLACE(() -> PrepareReplace.MidReplace.serializer),
-FINISH_REPLACE(() -> PrepareReplace.FinishReplace.serializer),
-
-CANCEL_SEQUENCE(() -> CancelInProgressSequence.serializer),
+PRE_INITIALIZE_CMS(0, () -> PreInitialize.serializer),
+INITIALIZE_CMS(1, () -> Initialize.serializer),
+FORCE_SNAPSHOT(2, () -> ForceSnapshot.serializer),
+SEAL_PERIOD(3, () -> SealPeriod.serializer),
+SCHEMA_CHANGE(4, () -> AlterSchema.serializer),
+REGISTER(5, () -> Register.serializer),
+UNREGISTER(6, () -> Unregister.serializer),
+
+UNSAFE_JOIN(7, () -> UnsafeJoin.serializer),
+PREPARE_JOIN(8, () -> PrepareJoin.serializer),
+START_JOIN(9, () -> PrepareJoin.StartJoin.serializer),
+MID_JOIN(10, () -> PrepareJoin.MidJoin.serializer),
+FINISH_JOIN(11, () -> PrepareJoin.FinishJoin.serializer),
+
+PREPARE_MOVE(12, () -> PrepareMove.serializer),
+START_MOVE(13, () -> PrepareMove.StartMove.serializer),
+MID_MOVE(14, () -> PrepareMove.MidMove.serializer),
+FINISH_MOVE(15, () -> PrepareMove.FinishMove.serializer),
+
+PREPARE_LEAVE(16, () -> PrepareLeave.serializer),
+START_LEAVE(17, () -> PrepareLeave.StartLeave.serializer),
+MID_LEAVE(18, () -> PrepareLeave.MidLeave.serializer),
+FINISH_LEAVE(19, () -> PrepareLeave.FinishLeave.serializer),
+ASSASSINATE(20, () -> Assassinate.serializer),
+
+PREPARE_REPLACE(21, () -> PrepareReplace.serializer),
+START_REPLACE(22, () -> PrepareReplace.StartReplace.serializer),
+MID_REPLACE(23, () -> PrepareReplace.MidReplace.serializer),
+FINISH_REPLACE(24, () -> PrepareReplace.FinishReplace.serializer),
+
+CANCEL_SEQUENCE(25, () -> CancelInProgressSequence.serializer),
 
 @Deprecated(since = "CEP-21")
-START_ADD_TO_CMS(() -> StartAddToCMS.serializer),
+START_ADD_TO_CMS(26, () -> StartAddToCMS.serializer),
 @Deprecated(since = "CEP-21")
-FINISH_ADD_TO_CMS(() -> FinishAddToCMS.serializer),
+FINISH_ADD_TO_CMS(27, () -> FinishAddToCMS.serializer),
 @Deprecated(since = "CEP-21")
-REMOVE_FROM_CMS(() -> RemoveFromCMS.serializer),
+REMOVE_FROM_CMS(28, ()

(cassandra) 01/03: Fix version check in InProgressSequences serialization

2024-03-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 60fe2dc61d3ea3d241e7e624f7a3ef94bd427b2f
Author: Marcus Eriksson 
AuthorDate: Wed Jan 31 12:52:16 2024 +0100

Fix version check in InProgressSequences serialization

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19348
---
 .../org/apache/cassandra/tcm/sequences/InProgressSequences.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java 
b/src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java
index a8b2b16259..86b449c346 100644
--- a/src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java
+++ b/src/java/org/apache/cassandra/tcm/sequences/InProgressSequences.java
@@ -223,7 +223,7 @@ public class InProgressSequences implements 
MetadataValue
 out.writeInt(t.state.size());
 for (Map.Entry> entry : t.state.entrySet())
 {
-if (Version.UNKNOWN.isBefore(V2))
+if (version.isBefore(V2))
 {
 NodeId.serializer.serialize((NodeId) entry.getKey(), out, 
version);
 MultiStepOperation seq = entry.getValue();
@@ -249,7 +249,7 @@ public class InProgressSequences implements 
MetadataValue
 ImmutableMap.Builder> res = ImmutableMap.builder();
 for (int i = 0; i < ipsSize; i++)
 {
-if (Version.UNKNOWN.isBefore(V2))
+if (version.isBefore(V2))
 {
 NodeId nodeId = NodeId.serializer.deserialize(in, version);
 MultiStepOperation.Kind kind = 
MultiStepOperation.Kind.valueOf(in.readUTF());
@@ -273,7 +273,7 @@ public class InProgressSequences implements 
MetadataValue
 size += sizeof(t.state.size());
 for (Map.Entry> entry : t.state.entrySet())
 {
-if (Version.UNKNOWN.isBefore(V2))
+if (version.isBefore(V2))
 {
 size += NodeId.serializer.serializedSize((NodeId) 
entry.getKey(), version);
 MultiStepOperation seq = entry.getValue();


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



(cassandra) 03/03: Flush snapshot table on every write and introduce reversed long local partitioner.

2024-03-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit f31d72e8758ee1018435612775c73f7addbb6ec4
Author: Marcus Eriksson 
AuthorDate: Mon Feb 12 14:23:25 2024 +0100

Flush snapshot table on every write and introduce reversed long local 
partitioner.

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19391
---
 .../org/apache/cassandra/db/SystemKeyspace.java|  22 +-
 .../dht/ReversedLongLocalPartitioner.java  | 224 +
 2 files changed, 241 insertions(+), 5 deletions(-)

diff --git a/src/java/org/apache/cassandra/db/SystemKeyspace.java 
b/src/java/org/apache/cassandra/db/SystemKeyspace.java
index 9e6b53ee3c..ff54d226b0 100644
--- a/src/java/org/apache/cassandra/db/SystemKeyspace.java
+++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java
@@ -62,7 +62,6 @@ import org.apache.cassandra.db.commitlog.CommitLogPosition;
 import org.apache.cassandra.db.compaction.CompactionHistoryTabularData;
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.marshal.LongType;
-import org.apache.cassandra.db.marshal.ReversedType;
 import org.apache.cassandra.db.marshal.TimeUUIDType;
 import org.apache.cassandra.db.marshal.TupleType;
 import org.apache.cassandra.db.marshal.UTF8Type;
@@ -73,6 +72,7 @@ import org.apache.cassandra.db.rows.Rows;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.dht.LocalPartitioner;
 import org.apache.cassandra.dht.Range;
+import org.apache.cassandra.dht.ReversedLongLocalPartitioner;
 import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.gms.EndpointState;
@@ -505,7 +505,7 @@ public final class SystemKeyspace
 "epoch bigint PRIMARY 
KEY," +
 "period bigint," +
 "snapshot blob)")
-  .partitioner(new 
LocalPartitioner(ReversedType.getInstance(LongType.instance)))
+  
.partitioner(ReversedLongLocalPartitioner.instance)
   .build();
 
 @Deprecated(since = "4.0")
@@ -1990,6 +1990,7 @@ public final class SystemKeyspace
 logger.info("Storing snapshot of cluster metadata at epoch {} (period 
{})", epoch, period);
 String query = String.format("INSERT INTO %s.%s (epoch, period, 
snapshot) VALUES (?, ?, ?)", SchemaConstants.SYSTEM_KEYSPACE_NAME, 
SNAPSHOT_TABLE_NAME);
 executeInternal(query, epoch.getEpoch(), period, snapshot);
+forceBlockingFlush(SNAPSHOT_TABLE_NAME);
 }
 
 public static ByteBuffer getSnapshot(Epoch epoch)
@@ -2003,12 +2004,23 @@ public final class SystemKeyspace
 }
 
 /**
- * WARNING: we use token(epoch) >= search in the query below - this is due 
the fact that we use LocalPartitioner with a reversed LongToken
- *  and this is not quite supported (yet), so the query is 
actually `token(epoch) <= search` which is what we want here
+ * We use ReversedLongLocalPartitioner here, which calculates token as 
Long.MAX_VALUE - key
+ *
+ * table is something like (assuming Long.MAX_VALUE is 1000 for easier 
calculations...):
+ * epoch | token(epoch)
+ * 
+ *   100 | 900
+ *90 | 910
+ *80 | 920
+ *70 | 970
+ *...
+ *
+ * so to find the first snapshot before epoch 85, we query the table with 
token(epoch) >= token(85)=915. Which gives us
+ * epoch 80, 70... and the first row is the first snapshot before `search`
  */
 public static ByteBuffer findSnapshotBefore(Epoch search)
 {
-String query = String.format("SELECT snapshot FROM %s.%s WHERE 
token(epoch) >= ? LIMIT 1", SchemaConstants.SYSTEM_KEYSPACE_NAME, 
SNAPSHOT_TABLE_NAME);
+String query = String.format("SELECT snapshot FROM %s.%s WHERE 
token(epoch) >= token(?) LIMIT 1", SchemaConstants.SYSTEM_KEYSPACE_NAME, 
SNAPSHOT_TABLE_NAME);
 
 UntypedResultSet res = executeInternal(query, search.getEpoch());
 if (res != null && !res.isEmpty())
diff --git 
a/src/java/org/apache/cassandra/dht/ReversedLongLocalPartitioner.java 
b/src/java/org/apache/cassandra/dht/ReversedLongLocalPartitioner.java
new file mode 100644
index 00..c423ba7e13
--- /dev/null
+++ b/src/java/org/apache/cassandra/dht/ReversedLongLocalPartitioner.java
@@ -0,0 +1,224 @@
+/*
+ * 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
+ * rega

(cassandra) branch trunk updated (baef2447bb -> f31d72e875)

2024-03-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from baef2447bb Merge branch 'cassandra-5.0' into trunk
 new 60fe2dc61d Fix version check in InProgressSequences serialization
 new 0e5fb78c01 Add an explicit id to Transformation.Kind
 new f31d72e875 Flush snapshot table on every write and introduce reversed 
long local partitioner.

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|  22 +-
 .../dht/ReversedLongLocalPartitioner.java  | 224 +
 .../org/apache/cassandra/tcm/Transformation.java   | 111 ++
 .../tcm/sequences/InProgressSequences.java |   6 +-
 4 files changed, 311 insertions(+), 52 deletions(-)
 create mode 100644 
src/java/org/apache/cassandra/dht/ReversedLongLocalPartitioner.java


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



(cassandra) 01/02: Improve setup and initialisation of LocalLog/LogSpec

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

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

commit 6b3958f1d83777e295690a663610b6b29ed1efae
Author: Alex Petrov 
AuthorDate: Fri Nov 17 17:13:30 2023 +0100

Improve setup and initialisation of LocalLog/LogSpec

Patch by Alex Petrov; reviewed by Sam Tunnicliffe and marcuse for 
CASSANDRA-19271
---
 CHANGES.txt|   1 +
 .../apache/cassandra/schema/DistributedSchema.java |   9 +-
 .../cassandra/tcm/ClusterMetadataService.java  |  38 ++--
 src/java/org/apache/cassandra/tcm/Period.java  |   5 +-
 src/java/org/apache/cassandra/tcm/Startup.java |  52 ++---
 .../cassandra/tcm/StubClusterMetadataService.java  |   8 +-
 .../cassandra/tcm/listeners/SchemaListener.java|  10 +-
 .../org/apache/cassandra/tcm/log/LocalLog.java | 231 -
 .../org/apache/cassandra/tcm/log/LogStorage.java   |   1 +
 .../cassandra/tcm/log/SystemKeyspaceStorage.java   |   5 +
 .../distributed/test/jmx/JMXFeatureTest.java   |   3 +-
 .../distributed/test/log/CMSTestBase.java  |   9 +-
 .../test/log/ClusterMetadataTestHelper.java|  64 +++---
 .../test/log/CoordinatorPathTestBase.java  |  18 +-
 .../distributed/test/ring/DecommissionTest.java|   9 +-
 .../unit/org/apache/cassandra/ServerTestUtils.java |  41 ++--
 .../apache/cassandra/hints/HintsUpgradeTest.java   |   2 +
 .../cassandra/service/ClientWarningsTest.java  |  67 +++---
 .../apache/cassandra/tcm/BootWithMetadataTest.java |   3 +-
 .../cassandra/tcm/DiscoverySimulationTest.java |   7 +-
 .../org/apache/cassandra/tcm/LogStateTest.java |  16 +-
 .../org/apache/cassandra/tcm/log/LocalLogTest.java |  25 ++-
 .../tcm/log/LogListenerNotificationTest.java   |   9 +-
 .../io/sstable/StressCQLSSTableWriter.java |   3 -
 24 files changed, 370 insertions(+), 266 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 5ad47d72bd..64841aa886 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.1
+ * Improve setup and initialisation of LocalLog/LogSpec (CASSANDRA-19271)
  * Refactor structure of caching metrics and expose auth cache metrics via JMX 
(CASSANDRA-17062)
  * Allow CQL client certificate authentication to work without sending an 
AUTHENTICATE request (CASSANDRA-18857)
  * Extend nodetool tpstats and system_views.thread_pools with detailed pool 
parameters (CASSANDRA-19289) 
diff --git a/src/java/org/apache/cassandra/schema/DistributedSchema.java 
b/src/java/org/apache/cassandra/schema/DistributedSchema.java
index fbdf9c1c88..86dd1d5117 100644
--- a/src/java/org/apache/cassandra/schema/DistributedSchema.java
+++ b/src/java/org/apache/cassandra/schema/DistributedSchema.java
@@ -123,6 +123,10 @@ public class DistributedSchema implements 
MetadataValue
 {
 keyspaceInstances.putAll(prev.keyspaceInstances);
 
+// If there are keyspaces in schema, but none of them are initialised, 
we're in first boot. Initialise all.
+if (!prev.isEmpty() && prev.keyspaceInstances.isEmpty())
+prev = DistributedSchema.empty();
+
 Keyspaces.KeyspacesDiff ksDiff = Keyspaces.diff(prev.getKeyspaces(), 
getKeyspaces());
 
 SchemaChangeNotifier schemaChangeNotifier = 
Schema.instance.schemaChangeNotifier();
@@ -148,8 +152,8 @@ public class DistributedSchema implements 
MetadataValue
 assert delta.before.name.equals(delta.after.name);
 
 // drop tables and views
-delta.views.dropped.forEach(v -> dropView(keyspace, v, true));
-delta.tables.dropped.forEach(t -> dropTable(keyspace, t, 
true));
+delta.views.dropped.forEach(v -> dropView(keyspace, v, 
loadSSTables));
+delta.tables.dropped.forEach(t -> dropTable(keyspace, t, 
loadSSTables));
 
 // add tables and views
 delta.tables.created.forEach(t -> createTable(keyspace, t, 
loadSSTables));
@@ -164,7 +168,6 @@ public class DistributedSchema implements 
MetadataValue
 
keyspace.viewManager.reload(keyspaces.get(keyspace.getName()).get());
 }
 
-//schemaChangeNotifier.notifyKeyspaceAltered(delta);
 SchemaDiagnostics.keyspaceAltered(Schema.instance, delta);
 });
 
diff --git a/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java 
b/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java
index 01abe4abdf..1077e2dded 100644
--- a/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java
+++ b/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java
@@ -40,6 +40,7 @@ import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.config.CassandraRelevantProperties;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.exceptions

(cassandra) branch trunk updated (5ca972b145 -> 6ffd2677ee)

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

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


from 5ca972b145 Merge branch 'cassandra-5.0' into trunk
 new 6b3958f1d8 Improve setup and initialisation of LocalLog/LogSpec
 new 6ffd2677ee Remove sealed_periods and last_sealed_period tables

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:
 CHANGES.txt|   2 +
 .../org/apache/cassandra/db/SystemKeyspace.java| 102 ++-
 .../cassandra/dht/ByteOrderedPartitioner.java  |   2 +
 .../cassandra/dht/OrderPreservingPartitioner.java  |   2 +
 src/java/org/apache/cassandra/net/Verb.java|   2 +-
 .../schema/DistributedMetadataLogKeyspace.java | 121 +++--
 .../apache/cassandra/schema/DistributedSchema.java |   9 +-
 .../cassandra/tcm/AbstractLocalProcessor.java  |  26 +-
 .../cassandra/tcm/AtomicLongBackedProcessor.java   |  86 +++---
 .../cassandra/tcm/ClusterMetadataService.java  |  66 +++--
 src/java/org/apache/cassandra/tcm/Commit.java  |  22 +-
 .../org/apache/cassandra/tcm/FetchPeerLog.java |   5 +-
 .../apache/cassandra/tcm/MetadataSnapshots.java|  50 +++-
 src/java/org/apache/cassandra/tcm/Period.java  | 182 -
 .../cassandra/tcm/RecentlySealedPeriods.java   | 140 --
 .../org/apache/cassandra/tcm/RemoteProcessor.java  |   2 +-
 src/java/org/apache/cassandra/tcm/Sealed.java  | 128 -
 src/java/org/apache/cassandra/tcm/Startup.java |  51 ++--
 .../cassandra/tcm/StubClusterMetadataService.java  |   8 +-
 .../tcm/extensions/AbstractExtensionValue.java |  16 ++
 .../tcm/listeners/MetadataSnapshotListener.java|   2 -
 .../cassandra/tcm/listeners/SchemaListener.java|  10 +-
 .../org/apache/cassandra/tcm/log/LocalLog.java | 235 +---
 .../org/apache/cassandra/tcm/log/LogReader.java| 137 +-
 .../org/apache/cassandra/tcm/log/LogState.java | 301 -
 .../org/apache/cassandra/tcm/log/LogStorage.java   |  34 ++-
 .../org/apache/cassandra/tcm/log/Replication.java  | 260 --
 .../cassandra/tcm/log/SystemKeyspaceStorage.java   | 109 +---
 .../tcm/serialization/MessageSerializers.java  |  11 -
 .../tcm/transformations/CustomTransformation.java  |  30 ++
 .../cassandra/distributed/shared/ClusterUtils.java |   2 +-
 .../distributed/test/jmx/JMXFeatureTest.java   |   3 +-
 .../distributed/test/log/CMSTestBase.java  |   9 +-
 .../test/log/ClusterMetadataTestHelper.java|  63 ++---
 .../test/log/CoordinatorPathTestBase.java  |  33 ++-
 .../distributed/test/log/DistributedLogTest.java   |   7 +-
 .../test/log/FetchLogFromPeersTest.java|   8 +-
 .../distributed/test/log/ForceSnapshotTest.java|   2 +-
 .../distributed/test/log/ReplayPersistedTest.java  | 154 +++
 .../test/log/SystemKeyspaceStorageTest.java|  82 ++
 .../distributed/test/ring/DecommissionTest.java|   9 +-
 .../ClusterMetadataSingleNodeUpgradeTest.java  |   2 +-
 .../unit/org/apache/cassandra/ServerTestUtils.java |  41 +--
 .../apache/cassandra/dht/PartitionerTestCase.java  |   1 +
 .../apache/cassandra/hints/HintsUpgradeTest.java   |   2 +
 .../cassandra/service/ClientWarningsTest.java  |  67 +++--
 .../apache/cassandra/tcm/BootWithMetadataTest.java |   3 +-
 .../cassandra/tcm/DiscoverySimulationTest.java |   7 +-
 .../org/apache/cassandra/tcm/GetLogStateTest.java  | 198 ++
 .../org/apache/cassandra/tcm/LogStateTest.java |  16 +-
 .../cassandra/tcm/RecentlySealedPeriodsTest.java   | 112 
 .../cassandra/tcm/log/DistributedLogStateTest.java |  31 +--
 .../org/apache/cassandra/tcm/log/LocalLogTest.java |  25 +-
 .../tcm/log/LocalStorageLogStateTest.java  |  24 +-
 .../tcm/log/LogListenerNotificationTest.java   |   9 +-
 .../apache/cassandra/tcm/log/LogStateTestBase.java | 133 +
 .../io/sstable/StressCQLSSTableWriter.java |   3 -
 57 files changed, 1458 insertions(+), 1739 deletions(-)
 delete mode 100644 src/java/org/apache/cassandra/tcm/RecentlySealedPeriods.java
 delete mode 100644 src/java/org/apache/cassandra/tcm/Sealed.java
 delete mode 100644 src/java/org/apache/cassandra/tcm/log/Replication.java
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/test/log/ReplayPersistedTest.java
 create mode 100644 test/unit/org/apache/cassandra/tcm/GetLogStateTest.java
 delete mode 100644 
test/unit/org/apache/cassandra/tcm/RecentlySealedPeriodsTest.java


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

(cassandra-dtest) branch trunk updated: Stop trying to snapshot removed tables in snapshot_test.py

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

marcuse 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 26b939dc Stop trying to snapshot removed tables in snapshot_test.py
26b939dc is described below

commit 26b939dca68dcc8573a7fa36b5c0598fbd1c95fb
Author: Marcus Eriksson 
AuthorDate: Wed Jan 24 09:14:34 2024 +0100

Stop trying to snapshot removed tables in snapshot_test.py

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19189
---
 snapshot_test.py | 12 
 1 file changed, 12 deletions(-)

diff --git a/snapshot_test.py b/snapshot_test.py
index 5766f636..2a72b98d 100644
--- a/snapshot_test.py
+++ b/snapshot_test.py
@@ -343,8 +343,6 @@ class TestArchiveCommitlog(SnapshotTester):
 if self.cluster.version() >= LooseVersion('5.1'):
 local_dirs = self.make_snapshot(node1, 'system', 
'local_metadata_log', 'local_metadata_log')
 metadata_snapshot_dirs = self.make_snapshot(node1, 'system', 
'metadata_snapshots', 'metadata_snapshots')
-sealed_dirs = self.make_snapshot(node1, 'system', 
'metadata_sealed_periods', 'metadata_sealed_periods')
-last_sealed_dirs = self.make_snapshot(node1, 'system', 
'metadata_last_sealed_period', 'metadata_last_sealed_period')
 cluster_metadata_snapshot_dirs = self.make_snapshot(node1, 
'system_cluster_metadata', 'distributed_metadata_log', 
'distributed_metadata_log')
 
 try:
@@ -427,10 +425,6 @@ class TestArchiveCommitlog(SnapshotTester):
 self.restore_snapshot(local_dir, node1, 'system', 
'local_metadata_log', 'local_metadata_log')
 for snapshot_dir in metadata_snapshot_dirs:
 self.restore_snapshot(snapshot_dir, node1, 'system', 
'metadata_snapshots', 'metadata_snapshots')
-for sealed_dir in sealed_dirs:
-self.restore_snapshot(sealed_dir, node1, 'system', 
'metadata_sealed_periods', 'metadata_sealed_periods')
-for last_sealed_dir in last_sealed_dirs:
-self.restore_snapshot(last_sealed_dir, node1, 'system', 
'metadata_last_sealed_period', 'metadata_last_sealed_period')
 for cm_dir in cluster_metadata_snapshot_dirs:
 self.restore_snapshot(cm_dir, node1, 
'system_cluster_metadata', 'distributed_metadata_log', 
'distributed_metadata_log')
 
@@ -508,12 +502,6 @@ class TestArchiveCommitlog(SnapshotTester):
 logger.debug("removing snapshot_dir: " + 
",".join(metadata_snapshot_dirs))
 for metadata_snapshot_dir in metadata_snapshot_dirs:
 shutil.rmtree(metadata_snapshot_dir)
-logger.debug("removing snapshot_dir: " + ",".join(sealed_dirs))
-for sealed_snapshot_dir in sealed_dirs:
-shutil.rmtree(sealed_snapshot_dir)
-logger.debug("removing snapshot_dir: " + 
",".join(last_sealed_dirs))
-for last_sealed_snapshot_dir in last_sealed_dirs:
-shutil.rmtree(last_sealed_snapshot_dir)
 logger.debug("removing snapshot_dir: " + 
",".join(cluster_metadata_snapshot_dirs))
 for cm_snapshot_dir in cluster_metadata_snapshot_dirs:
 shutil.rmtree(cm_snapshot_dir)


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



(cassandra) branch trunk updated: Avoid trying to get replication factor for system_cluster_metadata before we have a CMS

2024-01-18 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 43eb2a4bde Avoid trying to get replication factor for 
system_cluster_metadata before we have a CMS
43eb2a4bde is described below

commit 43eb2a4bdee169e0f9338afab4f70009604997b2
Author: Marcus Eriksson 
AuthorDate: Tue Jan 16 14:13:27 2024 +0100

Avoid trying to get replication factor for system_cluster_metadata before 
we have a CMS

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19269
---
 src/java/org/apache/cassandra/locator/MetaStrategy.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/locator/MetaStrategy.java 
b/src/java/org/apache/cassandra/locator/MetaStrategy.java
index ac9685227e..a16d4e68bb 100644
--- a/src/java/org/apache/cassandra/locator/MetaStrategy.java
+++ b/src/java/org/apache/cassandra/locator/MetaStrategy.java
@@ -60,7 +60,9 @@ public class MetaStrategy extends SystemStrategy
 @Override
 public ReplicationFactor getReplicationFactor()
 {
-ClusterMetadata metadata = ClusterMetadata.current();
+ClusterMetadata metadata = ClusterMetadata.currentNullable();
+if (metadata == null || metadata.epoch.isEqualOrBefore(Epoch.FIRST))
+return ReplicationFactor.fullOnly(1);
 int rf = 
metadata.placements.get(ReplicationParams.meta(metadata)).writes.forRange(entireRange).get().byEndpoint.size();
 return ReplicationFactor.fullOnly(rf);
 }


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



(cassandra) branch trunk updated: Fix startup ExceptionInInitializerError when upgrade from 5.0-beta1 to trunk

2024-01-18 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 7f354571f3 Fix startup ExceptionInInitializerError when upgrade from 
5.0-beta1 to trunk
7f354571f3 is described below

commit 7f354571f3b4cb96a734749969612f4c743e437a
Author: maoling 
AuthorDate: Wed Jan 10 00:30:00 2024 +0800

Fix startup ExceptionInInitializerError when upgrade from 5.0-beta1 to trunk

Patch by Ling Mao; reviewed by marcuse for CASSANDRA-19263
---
 src/java/org/apache/cassandra/net/MessagingService.java| 2 ++
 src/java/org/apache/cassandra/service/CassandraDaemon.java | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/net/MessagingService.java 
b/src/java/org/apache/cassandra/net/MessagingService.java
index d8512103da..8859d1a330 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -226,6 +226,8 @@ public class MessagingService extends 
MessagingServiceMBeanImpl implements Messa
 
 public static final Version CURRENT;
 
+private static final Logger logger = 
LoggerFactory.getLogger(Version.class);
+
 static
 {
  if (DatabaseDescriptor.getStorageCompatibilityMode().isBefore(5))
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java 
b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 504f715347..8518a9ba99 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -271,7 +271,7 @@ public class CassandraDaemon
 }
 catch (InterruptedException | ExecutionException | IOException e)
 {
-throw new AssertionError("Can't initialize cluster metadata 
service");
+throw new AssertionError("Can't initialize cluster metadata 
service", e);
 }
 catch (StartupException e)
 {


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



(cassandra) branch trunk updated: Avoid race inserting new data in compaction_history during truncation in SystemKeyspaceMigrator41Test.testMigrateCompactionHistory

2023-12-12 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 901786ec27 Avoid race inserting new data in compaction_history during 
truncation in SystemKeyspaceMigrator41Test.testMigrateCompactionHistory
901786ec27 is described below

commit 901786ec27f726305ba665056a868b37d9cb3e38
Author: Marcus Eriksson 
AuthorDate: Mon Dec 11 16:47:19 2023 +0100

Avoid race inserting new data in compaction_history during truncation in 
SystemKeyspaceMigrator41Test.testMigrateCompactionHistory

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19098
---
 .../org/apache/cassandra/db/SystemKeyspaceMigrator41Test.java| 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/test/unit/org/apache/cassandra/db/SystemKeyspaceMigrator41Test.java 
b/test/unit/org/apache/cassandra/db/SystemKeyspaceMigrator41Test.java
index 2a1561b8a1..f9a09608a4 100644
--- a/test/unit/org/apache/cassandra/db/SystemKeyspaceMigrator41Test.java
+++ b/test/unit/org/apache/cassandra/db/SystemKeyspaceMigrator41Test.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.db;
 
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Map;
 import java.util.UUID;
@@ -32,6 +33,7 @@ import org.junit.Test;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.UntypedResultSet;
+import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.marshal.BytesType;
 import org.apache.cassandra.db.marshal.Int32Type;
 import org.apache.cassandra.db.marshal.LongType;
@@ -311,10 +313,15 @@ public class SystemKeyspaceMigrator41Test extends 
CQLTester
 assertEquals(ImmutableMap.of(), 
row.getMap("compaction_properties", UTF8Type.instance, UTF8Type.instance));
 }
 assertEquals(1, rowCount);
+Keyspace.all().forEach(ks -> {
+ks.getColumnFamilyStores().forEach(cfs -> {
+cfs.disableAutoCompaction();
+
CompactionManager.instance.waitForCessation(Collections.singleton(cfs), 
(sstable) -> true);
+});
+});
 
 //Test nulls/missing don't prevent the row from propagating
 execute(String.format("TRUNCATE %s", table));
-
 execute(String.format("INSERT INTO %s (id) VALUES (?)", table), 
compactionId);
 SystemKeyspaceMigrator41.migrateCompactionHistory();
 


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



(cassandra) branch trunk updated: Don't start MessagingService unnecessarily to speed up tests and to avoid memory leak

2023-12-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 1a46e96890 Don't start MessagingService unnecessarily to speed up 
tests and to avoid memory leak
1a46e96890 is described below

commit 1a46e96890d924723ccaef42bc8a94ebc2119045
Author: Marcus Eriksson 
AuthorDate: Wed Dec 6 14:09:48 2023 +0100

Don't start MessagingService unnecessarily to speed up tests and to avoid 
memory leak

Patch by marcuse; reviewed by Alex Petrov for CASSANDRA-19125
---
 src/java/org/apache/cassandra/gms/Gossiper.java |  3 ---
 src/java/org/apache/cassandra/service/StorageService.java   |  8 
 .../org/apache/cassandra/distributed/impl/Instance.java | 13 +
 .../cassandra/distributed/test/log/ConsistentLeaveTest.java |  2 ++
 .../cassandra/distributed/test/log/ConsistentMoveTest.java  |  2 ++
 .../cassandra/distributed/test/log/FailedLeaveTest.java |  2 ++
 .../apache/cassandra/distributed/test/log/FuzzTestBase.java |  5 +
 .../test/log/InProgressSequenceCoordinationTest.java|  9 ++---
 .../distributed/test/log/ResumableStartupTest.java  |  1 +
 .../cassandra/distributed/test/ring/CMSMembershipTest.java  |  6 --
 .../test/topology/DecommissionAvoidTimeouts.java|  2 +-
 .../org/apache/cassandra/streaming/LongStreamingTest.java   |  2 ++
 .../apache/cassandra/auth/MutualTlsAuthenticatorTest.java   |  2 ++
 test/unit/org/apache/cassandra/cql3/CQLTester.java  |  2 ++
 .../apache/cassandra/io/sstable/CQLSSTableWriterTest.java   |  2 ++
 .../org/apache/cassandra/io/sstable/LegacySSTableTest.java  |  3 ++-
 .../org/apache/cassandra/io/sstable/SSTableLoaderTest.java  |  3 ++-
 .../apache/cassandra/streaming/StreamingTransferTest.java   |  2 ++
 18 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java 
b/src/java/org/apache/cassandra/gms/Gossiper.java
index 5075c4e669..4359772d91 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -246,9 +246,6 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean,
 {
 try
 {
-//wait on messaging service to start listening
-MessagingService.instance().waitUntilListening();
-
 taskLock.lock();
 
 /* Update the local heartbeat counter. */
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index e491cf0777..51064ccaa4 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -739,14 +739,6 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 
 Schema.instance.saveSystemKeyspace();
 DatabaseDescriptor.getInternodeAuthenticator().setupInternode();
-try
-{
-MessagingService.instance().waitUntilListening();
-}
-catch (InterruptedException e)
-{
-throw new RuntimeException("Could not finish waiting until 
listening", e);
-}
 
 if (ClusterMetadataService.state() == 
ClusterMetadataService.State.GOSSIP)
 {
diff --git 
a/test/distributed/org/apache/cassandra/distributed/impl/Instance.java 
b/test/distributed/org/apache/cassandra/distributed/impl/Instance.java
index efacbbc3ec..25b2cb8703 100644
--- a/test/distributed/org/apache/cassandra/distributed/impl/Instance.java
+++ b/test/distributed/org/apache/cassandra/distributed/impl/Instance.java
@@ -164,6 +164,8 @@ import static java.util.concurrent.TimeUnit.MINUTES;
 import static 
org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.CONSISTENT_RANGE_MOVEMENT;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.CONSISTENT_SIMULTANEOUS_MOVES_ALLOW;
+import static 
org.apache.cassandra.config.CassandraRelevantProperties.GOSSIP_SETTLE_MIN_WAIT_MS;
+import static 
org.apache.cassandra.config.CassandraRelevantProperties.GOSSIP_SETTLE_POLL_INTERVAL_MS;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.RING_DELAY;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.TEST_CASSANDRA_SUITENAME;
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.TEST_CASSANDRA_TESTTAG;
@@ -678,6 +680,8 @@ public class Instance extends IsolatedExecutor implements 
IInvokableInstance
 {
 // TODO: hacky
 RING_DELAY.setLong(15000);
+GOSSIP_SETTLE_MIN_WAIT_MS.setLong(1000);
+GOSSIP_SETTLE_POLL_INTERVAL_MS.s

(cassandra) branch trunk updated: Enable bytebuddy rule after starting nodes to fix DecommissionAvoidWriteTimeoutsTest

2023-12-06 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 c5a2781b22 Enable bytebuddy rule after starting nodes to fix 
DecommissionAvoidWriteTimeoutsTest
c5a2781b22 is described below

commit c5a2781b22344356d8616c1bd4725d124d2ae46b
Author: Marcus Eriksson 
AuthorDate: Mon Dec 4 10:57:10 2023 +0100

Enable bytebuddy rule after starting nodes to fix 
DecommissionAvoidWriteTimeoutsTest

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19090
---
 .../cassandra/distributed/test/topology/DecommissionAvoidTimeouts.java  | 2 +-
 .../org/apache/cassandra/distributed/util/byterewrite/Undead.java   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/topology/DecommissionAvoidTimeouts.java
 
b/test/distributed/org/apache/cassandra/distributed/test/topology/DecommissionAvoidTimeouts.java
index 2047cddc58..6b84813723 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/topology/DecommissionAvoidTimeouts.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/topology/DecommissionAvoidTimeouts.java
@@ -90,7 +90,7 @@ public abstract class DecommissionAvoidTimeouts extends 
TestBaseImpl
 cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH 
replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 3, 
'datacenter2': 3}");
 String table = KEYSPACE + ".tbl";
 cluster.schemaChange("CREATE TABLE " + table + " (pk blob PRIMARY 
KEY)");
-
+cluster.forEach(i -> i.runOnInstance(() -> Undead.State.enabled = 
true));
 List dc1 = cluster.get(1, 2, 3, 4);
 List dc2 = cluster.get(5, 6, 7, 8);
 IInvokableInstance toDecom = dc2.get(1);
diff --git 
a/test/distributed/org/apache/cassandra/distributed/util/byterewrite/Undead.java
 
b/test/distributed/org/apache/cassandra/distributed/util/byterewrite/Undead.java
index 661d65f5b3..fec7dfe53a 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/util/byterewrite/Undead.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/util/byterewrite/Undead.java
@@ -45,7 +45,7 @@ public class Undead
 @Shared
 public static class State
 {
-public static volatile boolean enabled = true;
+public static volatile boolean enabled = false;
 }
 
 public static class BB


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



(cassandra) branch trunk updated: Lower the number of tables and repairs to avoid timeouts in ClearSnapshotTest

2023-12-01 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 f74c07d2d3 Lower the number of tables and repairs to avoid timeouts in 
ClearSnapshotTest
f74c07d2d3 is described below

commit f74c07d2d314d9127b210ec5dce9152110e060b3
Author: Marcus Eriksson 
AuthorDate: Fri Dec 1 14:21:09 2023 +0100

Lower the number of tables and repairs to avoid timeouts in 
ClearSnapshotTest

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19070
---
 .../org/apache/cassandra/distributed/test/ClearSnapshotTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/ClearSnapshotTest.java 
b/test/distributed/org/apache/cassandra/distributed/test/ClearSnapshotTest.java
index 384e79d468..1725f29f92 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/ClearSnapshotTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/ClearSnapshotTest.java
@@ -60,7 +60,7 @@ public class ClearSnapshotTest extends TestBaseImpl
   .withInstanceInitializer(BB::install)
   .start()))
 {
-int tableCount = 50;
+int tableCount = 20;
 for (int i = 0; i < tableCount; i++)
 {
 String ksname = "ks"+i;
@@ -103,7 +103,7 @@ public class ClearSnapshotTest extends TestBaseImpl
 activeRepairs = cluster.get(1).callOnInstance(() -> 
ActiveRepairService.instance().parentRepairSessionCount());
 Thread.sleep(50);
 }
-while (activeRepairs < 35);
+while (activeRepairs < 10);
 
 cluster.setUncaughtExceptionsFilter((t) -> t.getMessage() != null 
&& t.getMessage().contains("Parent repair session with id") );
 cluster.get(2).shutdown().get();
@@ -157,7 +157,6 @@ public class ClearSnapshotTest extends TestBaseImpl
 try(Cluster cluster = init(Cluster.build(3).withConfig(config ->

config.with(GOSSIP)
  
.with(NETWORK))
-  .withInstanceInitializer(BB::install)
   .start()))
 {
 cluster.schemaChange(withKeyspace("create table %s.tbl (id int 
primary key, x int)"));


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



(cassandra) branch trunk updated: Test failure: materialized_views_test.TestMaterializedViewsConsistency.test_multi_partition_consistent_reads_after_write

2023-12-01 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 bd25c05d52 Test failure: 
materialized_views_test.TestMaterializedViewsConsistency.test_multi_partition_consistent_reads_after_write
bd25c05d52 is described below

commit bd25c05d526a87b90d64300fde5635aeb78a565a
Author: Marcus Eriksson 
AuthorDate: Thu Nov 30 16:25:46 2023 +0100

Test failure: 
materialized_views_test.TestMaterializedViewsConsistency.test_multi_partition_consistent_reads_after_write

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19056
---
 src/java/org/apache/cassandra/db/view/TableViews.java  | 8 +---
 src/java/org/apache/cassandra/db/view/ViewManager.java | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/java/org/apache/cassandra/db/view/TableViews.java 
b/src/java/org/apache/cassandra/db/view/TableViews.java
index f717e3ec85..d054c54493 100644
--- a/src/java/org/apache/cassandra/db/view/TableViews.java
+++ b/src/java/org/apache/cassandra/db/view/TableViews.java
@@ -67,6 +67,7 @@ import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.schema.TableMetadata;
 import org.apache.cassandra.schema.TableMetadataRef;
 import org.apache.cassandra.service.StorageProxy;
+import org.apache.cassandra.tcm.ClusterMetadata;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.btree.BTree;
 import org.apache.cassandra.utils.btree.BTreeSet;
@@ -172,7 +173,7 @@ public class TableViews extends AbstractCollection
 {
 assert update.metadata().id.equals(baseTableMetadata.id);
 
-Collection views = updatedViews(update);
+Collection views = updatedViews(update, 
ClusterMetadata.currentNullable());
 if (views.isEmpty())
 return;
 
@@ -391,7 +392,7 @@ public class TableViews extends AbstractCollection
  * @param updates the updates applied to the base table.
  * @return the views affected by {@code updates}.
  */
-public Collection updatedViews(PartitionUpdate updates)
+public Collection updatedViews(PartitionUpdate updates, 
ClusterMetadata metadata)
 {
 List matchingViews = new ArrayList<>(views.size());
 
@@ -400,7 +401,8 @@ public class TableViews extends AbstractCollection
 ReadQuery selectQuery = view.getReadQuery();
 if (!selectQuery.selectsKey(updates.partitionKey()))
 continue;
-
+if (metadata != null && 
!metadata.schema.getKeyspaceMetadata(view.getDefinition().keyspace()).hasView(view.name))
+continue;
 matchingViews.add(view);
 }
 return matchingViews;
diff --git a/src/java/org/apache/cassandra/db/view/ViewManager.java 
b/src/java/org/apache/cassandra/db/view/ViewManager.java
index cf6b916e05..fe0f8236f4 100644
--- a/src/java/org/apache/cassandra/db/view/ViewManager.java
+++ b/src/java/org/apache/cassandra/db/view/ViewManager.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.schema.*;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.partitions.*;
 import org.apache.cassandra.service.StorageService;
+import org.apache.cassandra.tcm.ClusterMetadata;
 
 import static 
org.apache.cassandra.config.CassandraRelevantProperties.MV_ENABLE_COORDINATOR_BATCHLOG;
 
@@ -72,6 +73,7 @@ public class ViewManager
 if (!enableCoordinatorBatchlog && coordinatorBatchlog)
 return false;
 
+ClusterMetadata metadata = ClusterMetadata.currentNullable();
 for (IMutation mutation : mutations)
 {
 for (PartitionUpdate update : mutation.getPartitionUpdates())
@@ -81,7 +83,7 @@ public class ViewManager
 if (coordinatorBatchlog && 
keyspace.getReplicationStrategy().getReplicationFactor().allReplicas == 1)
 continue;
 
-if 
(!forTable(update.metadata()).updatedViews(update).isEmpty())
+if (!forTable(update.metadata()).updatedViews(update, 
metadata).isEmpty())
 return true;
 }
 }


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



(cassandra) 01/02: Test Failure: org.apache.cassandra.distributed.upgrade.ClusterMetadataUpgradeTest.upgradeWithHintsTest

2023-11-30 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit da868ab60724aa49af5cebc5e61f446db7d6169a
Author: Marcus Eriksson 
AuthorDate: Tue Nov 28 10:23:35 2023 +0100

Test Failure: 
org.apache.cassandra.distributed.upgrade.ClusterMetadataUpgradeTest.upgradeWithHintsTest

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19063
---
 .../ClusterMetadataSingleNodeUpgradeTest.java  |  47 ++
 .../upgrade/ClusterMetadataUpgradeHintsTest.java   |  76 ++
 .../upgrade/ClusterMetadataUpgradeHostIdTest.java  | 103 ++
 .../ClusterMetadataUpgradeIgnoreHostTest.java  |  50 +++
 .../ClusterMetadataUpgradeIgnoreHostsTest.java |  50 +++
 .../upgrade/ClusterMetadataUpgradeTest.java| 157 -
 .../MixedModeTTLOverflowAfterUpgradeTest.java  |  74 ++
 .../upgrade/MixedModeTTLOverflowUpgradeTest.java   |  42 +-
 8 files changed, 404 insertions(+), 195 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
 
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
new file mode 100644
index 00..fcda7f705b
--- /dev/null
+++ 
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
@@ -0,0 +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
+ *
+ * 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.distributed.upgrade;
+
+import org.junit.Test;
+
+import org.apache.cassandra.distributed.Constants;
+import org.apache.cassandra.distributed.api.Feature;
+
+public class ClusterMetadataSingleNodeUpgradeTest extends UpgradeTestBase
+{
+@Test
+public void testSingleNodeUpgrade() throws Throwable
+{
+new TestCase()
+.nodes(1)
+.nodesToUpgrade(1)
+.withConfig((cfg) -> cfg.with(Feature.NETWORK, Feature.GOSSIP)
+.set(Constants.KEY_DTEST_FULL_STARTUP, true))
+.upgradesToCurrentFrom(v41)
+.setup((cluster) -> {
+cluster.schemaChange(withKeyspace("ALTER KEYSPACE %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor':1}"));
+cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, 
ck int, v int, PRIMARY KEY (pk, ck))");
+})
+.runAfterClusterUpgrade((cluster) -> {
+cluster.get(1).nodetoolResult("initializecms").asserts().success();
+// make sure we can execute transformations:
+cluster.schemaChange(withKeyspace("ALTER TABLE %s.tbl with comment 
= 'hello123'"));
+}).run();
+}
+}
diff --git 
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHintsTest.java
 
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHintsTest.java
new file mode 100644
index 00..a55515f80f
--- /dev/null
+++ 
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHintsTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.distributed.upgrade;
+
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+
+import org.apache.cassan

(cassandra) 02/02: Test failure: org.apache.cassandra.distributed.test.ring.DecommissionTest.test*Version*

2023-11-30 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 5613d0a4fe783dc8df2761c1bd240666faa79f42
Author: Marcus Eriksson 
AuthorDate: Tue Nov 28 14:17:59 2023 +0100

Test failure: 
org.apache.cassandra.distributed.test.ring.DecommissionTest.test*Version*

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19078
---
 src/java/org/apache/cassandra/gms/Gossiper.java | 17 -
 .../cassandra/tcm/listeners/LegacyStateListener.java|  4 +++-
 .../distributed/test/ring/DecommissionTest.java |  3 ++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java 
b/src/java/org/apache/cassandra/gms/Gossiper.java
index 7bdc9c2fe7..5075c4e669 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -39,6 +39,7 @@ import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ConcurrentSkipListSet;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -464,7 +465,21 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean,
 return;
 }
 FutureTask task = new FutureTask<>(runnable);
-Stage.GOSSIP.execute(task);
+try
+{
+Stage.GOSSIP.execute(task);
+
+}
+catch (RejectedExecutionException e)
+{
+if (e.getMessage() != null && e.getMessage().contains("GossipStage 
has shut down"))
+{
+logger.warn("Not executing task on GossipStage - it has shut 
down", e);
+return;
+}
+else
+throw e;
+}
 try
 {
 task.get();
diff --git 
a/src/java/org/apache/cassandra/tcm/listeners/LegacyStateListener.java 
b/src/java/org/apache/cassandra/tcm/listeners/LegacyStateListener.java
index 05915e03bc..fef54d36cc 100644
--- a/src/java/org/apache/cassandra/tcm/listeners/LegacyStateListener.java
+++ b/src/java/org/apache/cassandra/tcm/listeners/LegacyStateListener.java
@@ -43,6 +43,7 @@ import org.apache.cassandra.tcm.membership.Directory;
 import org.apache.cassandra.tcm.membership.NodeId;
 import org.apache.cassandra.tcm.membership.NodeState;
 import org.apache.cassandra.tcm.sequences.BootstrapAndReplace;
+import org.apache.cassandra.utils.FBUtilities;
 
 import static org.apache.cassandra.gms.ApplicationState.SCHEMA;
 import static org.apache.cassandra.tcm.membership.NodeState.BOOTSTRAPPING;
@@ -120,7 +121,8 @@ public class LegacyStateListener implements 
ChangeListener.Async
 if (endpoint != null)
 {
 PeersTable.updateLegacyPeerTable(change, prev, next);
-GossipHelper.removeFromGossip(endpoint);
+if 
(!endpoint.equals(FBUtilities.getBroadcastAddressAndPort()))
+GossipHelper.removeFromGossip(endpoint);
 }
 }
 else if(next.directory.peerState(change) == MOVING)
diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/ring/DecommissionTest.java
 
b/test/distributed/org/apache/cassandra/distributed/test/ring/DecommissionTest.java
index 923602b67d..6e819d825a 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/ring/DecommissionTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/ring/DecommissionTest.java
@@ -94,7 +94,8 @@ public class DecommissionTest extends TestBaseImpl
 }
 
 @Test
-public void testDecomDirectoryMinMaxVersions() throws IOException {
+public void testDecomDirectoryMinMaxVersions() throws IOException
+{
 try (Cluster cluster = builder().withNodes(3)
 .start())
 {


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



(cassandra) branch trunk updated (5f2ff4f932 -> 5613d0a4fe)

2023-11-30 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 5f2ff4f932 Merge branch 'cassandra-5.0' into trunk
 new da868ab607 Test Failure: 
org.apache.cassandra.distributed.upgrade.ClusterMetadataUpgradeTest.upgradeWithHintsTest
 new 5613d0a4fe Test failure: 
org.apache.cassandra.distributed.test.ring.DecommissionTest.test*Version*

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/gms/Gossiper.java|  17 ++-
 .../tcm/listeners/LegacyStateListener.java |   4 +-
 .../distributed/test/ring/DecommissionTest.java|   3 +-
 ...a => ClusterMetadataSingleNodeUpgradeTest.java} |  29 ++--
 .../upgrade/ClusterMetadataUpgradeHintsTest.java   |  76 ++
 .../upgrade/ClusterMetadataUpgradeHostIdTest.java  | 103 ++
 ...a => ClusterMetadataUpgradeIgnoreHostTest.java} |  34 +++--
 ... => ClusterMetadataUpgradeIgnoreHostsTest.java} |  34 +++--
 .../upgrade/ClusterMetadataUpgradeTest.java| 157 -
 .../MixedModeTTLOverflowAfterUpgradeTest.java  |  74 ++
 .../upgrade/MixedModeTTLOverflowUpgradeTest.java   |  42 +-
 11 files changed, 322 insertions(+), 251 deletions(-)
 copy 
test/distributed/org/apache/cassandra/distributed/upgrade/{UpgradeTest.java => 
ClusterMetadataSingleNodeUpgradeTest.java} (59%)
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHintsTest.java
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHostIdTest.java
 copy 
test/distributed/org/apache/cassandra/distributed/upgrade/{UpgradeTest.java => 
ClusterMetadataUpgradeIgnoreHostTest.java} (52%)
 copy 
test/distributed/org/apache/cassandra/distributed/upgrade/{UpgradeTest.java => 
ClusterMetadataUpgradeIgnoreHostsTest.java} (52%)
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowAfterUpgradeTest.java


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



(cassandra) branch trunk updated (64ae866095 -> 01d8cbdd1e)

2023-11-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 64ae866095 Upgrade jackson to 2.15.3 and snakeyaml to 2.1
 new 806a395b9c Clone EndpointState before sending GossipShutdown message
 new 01d8cbdd1e Merge branch 'cassandra-5.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:
 CHANGES.txt | 1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 4 +++-
 2 files changed, 4 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-5.0' into trunk

2023-11-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 01d8cbdd1ec0f662173064dd65d0abcdc45e209d
Merge: 64ae866095 806a395b9c
Author: Marcus Eriksson 
AuthorDate: Thu Nov 30 08:32:46 2023 +0100

Merge branch 'cassandra-5.0' into trunk

 CHANGES.txt | 1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --cc CHANGES.txt
index 08ee99b2a7,d305e2f65e..ecc330bf8b
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,10 -1,5 +1,11 @@@
 -5.0-beta1
 +5.1
 + * Upgrade jackson to 2.15.3 and snakeyaml to 2.1 (CASSANDRA-18875)
 + * Transactional Cluster Metadata [CEP-21] (CASSANDRA-18330)
 + * Add ELAPSED command to cqlsh (CASSANDRA-18861)
 + * Add the ability to disable bulk loading of SSTables (CASSANDRA-18781)
 + * Clean up obsolete functions and simplify cql_version handling in cqlsh 
(CASSANDRA-18787)
 +Merged from 5.0:
+  * Clone EndpointState before sending GossipShutdown message (CASSANDRA-19115)
   * SAI indexes are marked queryable during truncation (CASSANDRA-19032)
   * Enable Direct-IO feature for CommitLog files using Java native API's. 
(CASSANDRA-18464)
   * SAI fixes for composite partitions, and static and non-static rows 
intersections (CASSANDRA-19034)
diff --cc src/java/org/apache/cassandra/gms/Gossiper.java
index 5ffa2d7bdb,b5b0caec77..7bdc9c2fe7
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@@ -1796,11 -2203,11 +1796,13 @@@ public class Gossiper implements IFailu
  if (mystate != null && !isSilentShutdownState(mystate) && 
StorageService.instance.isJoined())
  {
  logger.info("Announcing shutdown");
 +shutdownAnnounced.set(true);
 +
  addLocalApplicationState(ApplicationState.STATUS_WITH_PORT, 
StorageService.instance.valueFactory.shutdown(true));
  addLocalApplicationState(ApplicationState.STATUS, 
StorageService.instance.valueFactory.shutdown(true));
- Message message = 
Message.out(Verb.GOSSIP_SHUTDOWN, new GossipShutdown(mystate));
+ // clone endpointstate to avoid it changing between 
serializedSize and serialize calls
+ EndpointState clone = new EndpointState(mystate);
+ Message message = 
Message.out(Verb.GOSSIP_SHUTDOWN, new GossipShutdown(clone));
  for (InetAddressAndPort ep : liveEndpoints)
  MessagingService.instance().send(message, ep);
  
Uninterruptibles.sleepUninterruptibly(SHUTDOWN_ANNOUNCE_DELAY_IN_MS.getInt(), 
TimeUnit.MILLISECONDS);


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



(cassandra) branch cassandra-5.0 updated: Clone EndpointState before sending GossipShutdown message

2023-11-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/cassandra-5.0 by this push:
 new 806a395b9c Clone EndpointState before sending GossipShutdown message
806a395b9c is described below

commit 806a395b9ce6cbb81b1b7af9eb2f72fef97e0bbd
Author: Marcus Eriksson 
AuthorDate: Wed Nov 29 13:17:39 2023 +0100

Clone EndpointState before sending GossipShutdown message

Patch by marcuse; reviewed by David Capwell for CASSANDRA-19115
---
 CHANGES.txt | 1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 1b6eb2be89..d305e2f65e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.0-beta1
+ * Clone EndpointState before sending GossipShutdown message (CASSANDRA-19115)
  * SAI indexes are marked queryable during truncation (CASSANDRA-19032)
  * Enable Direct-IO feature for CommitLog files using Java native API's. 
(CASSANDRA-18464)
  * SAI fixes for composite partitions, and static and non-static rows 
intersections (CASSANDRA-19034)
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java 
b/src/java/org/apache/cassandra/gms/Gossiper.java
index 731965b65d..b5b0caec77 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -2205,7 +2205,9 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean,
 logger.info("Announcing shutdown");
 addLocalApplicationState(ApplicationState.STATUS_WITH_PORT, 
StorageService.instance.valueFactory.shutdown(true));
 addLocalApplicationState(ApplicationState.STATUS, 
StorageService.instance.valueFactory.shutdown(true));
-Message message = 
Message.out(Verb.GOSSIP_SHUTDOWN, new GossipShutdown(mystate));
+// clone endpointstate to avoid it changing between serializedSize 
and serialize calls
+EndpointState clone = new EndpointState(mystate);
+Message message = 
Message.out(Verb.GOSSIP_SHUTDOWN, new GossipShutdown(clone));
 for (InetAddressAndPort ep : liveEndpoints)
 MessagingService.instance().send(message, ep);
 
Uninterruptibles.sleepUninterruptibly(SHUTDOWN_ANNOUNCE_DELAY_IN_MS.getInt(), 
TimeUnit.MILLISECONDS);


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



(cassandra) 01/04: Test failure: org.apache.cassandra.db.RepairedDataInfoTest

2023-11-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 31a3ff17680c5a41e2ba859c398e405099ea4f1b
Author: Marcus Eriksson 
AuthorDate: Mon Nov 27 08:00:01 2023 +0100

Test failure: org.apache.cassandra.db.RepairedDataInfoTest

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19059
---
 test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java| 1 -
 test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java   | 1 -
 .../apache/cassandra/db/lifecycle/LifecycleTransactionTest.java| 7 ---
 .../unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java | 7 ---
 test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java   | 1 -
 test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java  | 1 -
 6 files changed, 18 deletions(-)

diff --git a/test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java 
b/test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java
index 43eebd19c1..11a507d083 100644
--- a/test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java
+++ b/test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java
@@ -69,7 +69,6 @@ public class RepairedDataInfoTest
 {
 ServerTestUtils.prepareServerNoRegister();
 CommitLog.instance.start();
-MockSchema.cleanup();
 String ks = "repaired_data_info_test";
 cfs = MockSchema.newCFS(ks, metadata -> metadata.addStaticColumn("s", 
UTF8Type.instance));
 metadata = cfs.metadata();
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java
index 6f72c21334..53efbc6f24 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java
@@ -51,7 +51,6 @@ public class HelpersTest
 {
 ServerTestUtils.prepareServerNoRegister();
 CommitLog.instance.start();
-MockSchema.cleanup();
 }
 
 static Set a = set(1, 2, 3);
diff --git 
a/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
index 8f197c1072..fb3cccace2 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LifecycleTransactionTest.java
@@ -25,7 +25,6 @@ import java.util.concurrent.atomic.AtomicReference;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
@@ -54,12 +53,6 @@ public class LifecycleTransactionTest extends 
AbstractTransactionalTest
 {
 private boolean incrementalBackups;
 
-@BeforeClass
-public static void setUp()
-{
-MockSchema.cleanup();
-}
-
 @Before
 public void disableIncrementalBackup()
 {
diff --git 
a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
index 710c869fab..c8fbc936ce 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
@@ -37,7 +37,6 @@ import java.util.stream.Stream;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.cassandra.Util;
@@ -81,12 +80,6 @@ public class LogTransactionTest extends 
AbstractTransactionalTest
 {
 private static final String KEYSPACE = "TransactionLogsTest";
 
-@BeforeClass
-public static void setUp()
-{
-MockSchema.cleanup();
-}
-
 protected AbstractTransactionalTest.TestableTransaction newTest() throws 
Exception
 {
 LogTransaction.waitForDeletions();
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
index c082ad40bb..96e041f3a7 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java
@@ -89,7 +89,6 @@ public class TrackerTest
 {
 ServerTestUtils.prepareServerNoRegister();
 CommitLog.instance.start();
-MockSchema.cleanup();
 }
 
 @Test
diff --git a/test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java
index 4dbb93ead1..a9710895b5 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java
@@ -55,7 +55,6 @@ public class ViewTest
 {
 ServerTestUtils.prepareServerNoRegister();
 CommitLog.instance.sta

(cassandra) 04/04: Test Failure: org.apache.cassandra.db.compaction.writers.CompactionAwareWriterTest.test*CompactionWriter-trie

2023-11-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 9167d599f3bfa81e57c629744d121f6d2bc794d1
Author: Marcus Eriksson 
AuthorDate: Mon Nov 27 14:08:26 2023 +0100

Test Failure: 
org.apache.cassandra.db.compaction.writers.CompactionAwareWriterTest.test*CompactionWriter-trie

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19091
---
 .../cassandra/db/compaction/writers/CompactionAwareWriterTest.java  | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/test/unit/org/apache/cassandra/db/compaction/writers/CompactionAwareWriterTest.java
 
b/test/unit/org/apache/cassandra/db/compaction/writers/CompactionAwareWriterTest.java
index b9142db88a..c9f6324b7e 100644
--- 
a/test/unit/org/apache/cassandra/db/compaction/writers/CompactionAwareWriterTest.java
+++ 
b/test/unit/org/apache/cassandra/db/compaction/writers/CompactionAwareWriterTest.java
@@ -24,6 +24,7 @@ import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Random;
@@ -37,6 +38,8 @@ import org.junit.Test;
 
 import org.apache.cassandra.ServerTestUtils;
 import org.apache.cassandra.Util;
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.config.ParameterizedClass;
 import org.apache.cassandra.cql3.CQLTester;
 import org.apache.cassandra.cql3.QueryProcessor;
 import org.apache.cassandra.db.ColumnFamilyStore;
@@ -66,6 +69,9 @@ public class CompactionAwareWriterTest extends CQLTester
 @BeforeClass
 public static void setUpClass()
 {
+DatabaseDescriptor.daemonInitialization();
+// we assert that we create a single sstable in populate(..) below - 
always use STCS
+DatabaseDescriptor.getRawConfig().default_compaction = new 
ParameterizedClass("SizeTieredCompactionStrategy", new HashMap<>());
 // Don't register/join the local node so that DiskBoundaries are empty 
(testMultiDatadirCheck depends on this)
 ServerTestUtils.prepareServerNoRegister();
 // Disabling durable write since we don't care


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



(cassandra) 02/04: Test failure: org.apache.cassandra.tools.JMXCompatabilityTest

2023-11-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit f6ea362d711ac8e06f254b18ba6fcf99e7e2c8cf
Author: Marcus Eriksson 
AuthorDate: Mon Nov 27 12:54:31 2023 +0100

Test failure: org.apache.cassandra.tools.JMXCompatabilityTest

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19060
---
 src/java/org/apache/cassandra/service/StorageService.java | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 093b1da6d8..865ecb14b2 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -792,7 +792,16 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 
 if (ClusterMetadataService.state() == 
ClusterMetadataService.State.REMOTE)
 Gossiper.instance.triggerRoundWithCMS();
-
+// Has to be called after the host id has potentially changed
+try
+{
+CacheService.instance.counterCache.loadSavedAsync().get();
+}
+catch (Throwable t)
+{
+JVMStabilityInspector.inspectThrowable(t);
+logger.warn("Error loading counter cache", t);
+}
 Gossiper.waitToSettle();
 
 NodeId self;


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



(cassandra) 03/04: Test failure: org.apache.cassandra.db.CorruptPrimaryIndexTest.bigPrimaryIndexDoesNotDetectDiskCorruption

2023-11-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit db52bef03a0595bbc679756053ccec1a37e86c23
Author: Marcus Eriksson 
AuthorDate: Mon Nov 27 13:24:47 2023 +0100

Test failure: 
org.apache.cassandra.db.CorruptPrimaryIndexTest.bigPrimaryIndexDoesNotDetectDiskCorruption

Patch by marcuse; reviewed by Sam Tunnicliffe for CASSANDRA-19061
---
 test/unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java 
b/test/unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java
index ba9f9fdd4c..ce3ccf0b30 100644
--- a/test/unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java
+++ b/test/unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java
@@ -41,7 +41,7 @@ public class CorruptPrimaryIndexTest extends 
CQLTester.InMemory
 if (!path.getFileName().toString().endsWith(endsWith))
 return false;
 Descriptor desc = Descriptor.fromFile(new File(path));
-if (!desc.ksname.equals(keyspace) && 
desc.cfname.equals(currentTable()))
+if (!desc.ksname.equals(keyspace) || 
!desc.cfname.equals(currentTable()))
 return false;
 return true;
 };


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



(cassandra) branch trunk updated (58d2132afc -> 9167d599f3)

2023-11-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 58d2132afc Merge branch 'cassandra-5.0' into trunk
 new 31a3ff1768 Test failure: org.apache.cassandra.db.RepairedDataInfoTest
 new f6ea362d71 Test failure: 
org.apache.cassandra.tools.JMXCompatabilityTest
 new db52bef03a Test failure: 
org.apache.cassandra.db.CorruptPrimaryIndexTest.bigPrimaryIndexDoesNotDetectDiskCorruption
 new 9167d599f3 Test Failure: 
org.apache.cassandra.db.compaction.writers.CompactionAwareWriterTest.test*CompactionWriter-trie

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:
 src/java/org/apache/cassandra/service/StorageService.java | 11 ++-
 .../unit/org/apache/cassandra/db/CorruptPrimaryIndexTest.java |  2 +-
 test/unit/org/apache/cassandra/db/RepairedDataInfoTest.java   |  1 -
 .../db/compaction/writers/CompactionAwareWriterTest.java  |  6 ++
 test/unit/org/apache/cassandra/db/lifecycle/HelpersTest.java  |  1 -
 .../cassandra/db/lifecycle/LifecycleTransactionTest.java  |  7 ---
 .../org/apache/cassandra/db/lifecycle/LogTransactionTest.java |  7 ---
 test/unit/org/apache/cassandra/db/lifecycle/TrackerTest.java  |  1 -
 test/unit/org/apache/cassandra/db/lifecycle/ViewTest.java |  1 -
 9 files changed, 17 insertions(+), 20 deletions(-)


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



(cassandra) branch trunk updated: Revert bad dtest repo in circleci conf

2023-11-24 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 d464c206e1 Revert bad dtest repo in circleci conf
d464c206e1 is described below

commit d464c206e1d71859f479995241b26b9bde0653e1
Author: Marcus Eriksson 
AuthorDate: Fri Nov 24 15:01:15 2023 +0100

Revert bad dtest repo in circleci conf
---
 .circleci/config.yml | 626 +--
 1 file changed, 313 insertions(+), 313 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 038c22578d..145afaa557 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -24,7 +24,7 @@ jobs:
 resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 25
+parallelism: 4
 steps:
 - attach_workspace:
 at: /home/cassandra
@@ -75,8 +75,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -111,10 +111,10 @@ jobs:
   j17_dtests:
 docker:
 - image: apache/cassandra-testing-ubuntu2004-java11:latest
-resource_class: large
+resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 50
+parallelism: 4
 steps:
 - attach_workspace:
 at: /home/cassandra
@@ -182,8 +182,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -246,8 +246,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -281,10 +281,10 @@ jobs:
   j17_cqlsh_dtests_py311_offheap:
 docker:
 - image: apache/cassandra-testing-ubuntu2004-java11:latest
-resource_class: large
+resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 50
+parallelism: 4
 steps:
 - attach_workspace:
 at: /home/cassandra
@@ -354,8 +354,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -392,7 +392,7 @@ jobs:
 resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 25
+parallelism: 4
 steps:
 - attach_workspace:
 at: /home/cassandra
@@ -443,8 +443,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -481,7 +481,7 @@ jobs:
 resource_class: medium
 working_directory: ~/
 shell: /bin/bash -eo pipefail -l
-parallelism: 25
+parallelism: 4
 steps:
 - attach_workspace:
 at: /home/cassandra
@@ -532,8 +532,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO: https://github.com/apache/cassandra-dtest.git
+- DTEST_BRANCH: trunk
 - CCM_MAX_HEAP_SIZE: 1024M
 - CCM_HEAP_NEWSIZE: 256M
 - REPEATED_TESTS_STOP_ON_FAILURE: false
@@ -597,8 +597,8 @@ jobs:
 - CASS_DRIVER_NO_EXTENSIONS: true
 - CASS_DRIVER_NO_CYTHON: true
 - CASSANDRA_SKIP_SYNC: true
-- DTEST_REPO: https://github.com/krummas/cassandra-dtest.git
-- DTEST_BRANCH: cep-21-tcm
+- DTEST_REPO

[cassandra] branch cep-21-tcm updated (e225ff7ca8 -> 4d6aab0324)

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

marcuse pushed a change to branch cep-21-tcm
in repository https://gitbox.apache.org/repos/asf/cassandra.git


 discard e225ff7ca8 [CEP-21] fix GossiperTest - this test now matches trunk
 discard 7b3292d7dc [CEP-21] CASSANDRA-18816 rebase fixes
 discard 72886b552b update dtest repo for cci
 discard a7b650a7dd [CEP-21] fix cqlshlib tests
 discard 9b5e6ab544 [CEP-21] remove authsetup
 discard 1ab867b39f [CEP-21] serialize MemtableParams when writing TableParams
 discard e187d7d616 [CEP-21] Upgrading a one node cluster to TCM fails 
attempting Gossip shadow round
 discard e332376df1 [CEP-21] Implement replacement with same address
 discard ebde83c2ea [CEP-21] fix nodetool bootstrap resume
 discard d9071b3f86 [CEP-21] Remove LEFT peers from system tables and exclude 
them during startup
 discard 396db98318 [CEP-21] Fix flaky distributed log test. While it fails 
very infrequently on CI, it consistently fails locally.
 discard fdc2297dba [CEP-21] Retry indefinitely for STARTUP messages.
 discard b147c48cf5 [CEP-21] Implement versioning for ranges
 discard b5de96fc46 [CEP-21] Handle case where removenode requires no streaming 
to restore RF
 discard d5bf9dfb64 [CEP-21] Remove redundant Keyspaces arg from 
SchemaTransformation::apply
 discard 0cac1679b9 [CEP-21] Don't trigger client warnings or guardrails when 
executing AlterSchema transformations
 discard b6089b248c [CEP-21] Validate schema alterations on coordinator
 discard 0eac2972e2 [CEP-21] Add a script for simulation running
 discard 0003c18243 [CEP-21] Add nextId to Directory serialization and make it 
possible to bump metadata serialization version
 discard 8e31d87922 [CEP-21] Add metric for CMS membership
 discard f769e462d6 [CEP-21] Reenable starting without joining 
(-Dcassandra.join_ring=false)
 discard 15cf99178d [CEP-21] Preparing DDL statements should capture the CQL 
string
 discard ad2380c29d rebase
 discard 0e66e6bf30 [CEP-21] Work with Storage Compatiblility Mode
 discard 14141d57ed storage_compat_mode: none
 discard 4301aa7b0a [CEP-21] Update tests which require the local node not to 
be joined by default
 discard 2030855d56 more test fixes
 discard 04abdd806e fix UnifiedCompactionStrategyTest
 discard 5f77d328cf rebase fix
 discard 2a439b075d Fix ByteBuddyExamplesTest
 discard 1baba286d5 rebase fixes
 discard 26cf755513 [CEP-21] Evict replaced endpoint from gossip
 discard 274095f0f8 [CEP-21] Avoid gossip deadlock by grabbing taskLock before 
runInGossipStageBlocking
 discard 8ab6865c73 [CEP-21] Python dtest fixes * maybe fix hintedhandoff test
 discard a43d41e84c [CEP-21] More in-jvm dtest fixes
 discard dc47281c94 [CEP-21] Use harry for generating data for coordinator path 
test
 discard 754809d889 [CEP-21] Various JVM Dtest fixes
 discard 5a285e24ed [CEP-21] Fix flaky consistentleave test
 discard bc972f0466 [CEP-21] Fix assassinate dtests
 discard 538e66bc98 [CEP-21] Fix MoveTest
 discard e7eb783490 [CEP-21] Fix paxos self execution tests
 discard 89fabd1456 [CEP-21] Fix IPMembershipTest
 discard b43848f597 [CEP-21] Fix reprepare tests
 discard d633faeecc [CEP-21] Reduce number of data harry writes to reduce 
flakiness
 discard d581f5c053 [CEP-21] Fix replacement tests
 discard a4c0337936 [CEP-21] Fix o.a.c.dht.BootstrapperTest
 discard 170eadae48 [CEP-21] Fix o.a.c.service.BootstrapTransientTest
 discard bfa4fa9ad2 [CEP-21] Fix o.a.c.db.StreamRequestTest
 discard 606c8845bc [CEP-21] Fix o.a.c.streaming.StreamRateLimiterTest
 discard 3f09c5d253 [CEP-21] Fix o.a.c.tools.TopPartitionsTest
 discard 0510917e60 [CEP-21] Fix 
o.a.c.io.sstable.format.RangeAwareSSTableWriterTest
 discard 019bc60c52 [CEP-21] Disable auto metadata snapshots during tests
 discard cd591e990f [CEP-21] Fix o.a.c.tcm.ownership.DeltaMapTest
 discard ca9a8faace [CEP-21] Syncronize processing of LocalLog in test code
 discard b73f125f16 [CEP-21] Fix MockSchema to use supplied keyspace name
 discard 72f0694eae [CEP-21] Fix o.a.c.db.view.ViewUtilsTest
 discard c1ffd969b5 [CEP-21] Fix 
o.a.c.service.reads.repair.[BlockingReadRepairTest|DiagEventsBlockingReadRepairTest]
 discard 82838e3aee [CEP-21] Restore previous behaviour when fetching effective 
ownership for a local system keyspace
 discard 0e9b3d27d3 [CEP-21] Fix o.a.c.db.CleanupTest
 discard 66dd732059 [CEP-21] Fix o.a.c.tcm.RemoteProcessorTest
 discard cd883b1051 [CEP-21] Remove obsolete 
o.a.c.locator.ReplicationStrategyEndpointCacheTest
 discard 3c676d0f8e [CEP-21] Fix o.a.c.locator.DynamicEndpointSnitchTest
 discard 024014a08e [CEP-21] Fix o.a.c.locator.ReplicaPlansTest
 discard aa93c0971d [CEP-21] Fix o.a.c.tcm.transformations.EventsMetadataTest
 discard 7e1a6ef181 [CEP-21] Fix o.a.c.tcm.transformations.PrepareLeaveTest
 discard c637a5efc8 [CEP-21] Fix o.a.c.cql3.KeyCacheCqlTest
 discard 068fc3db9b [CEP-21] Remove o.a.c.gms.ExpireEndpointTest.java (CMS 
updates now remove from gossip)
 discard 843416bb41 [CEP-21] Remove

[cassandra] branch cep-21-tcm updated (5cacbbcc75 -> e225ff7ca8)

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

marcuse pushed a change to branch cep-21-tcm
in repository https://gitbox.apache.org/repos/asf/cassandra.git


omit 5cacbbcc75 [CEP-21] Work with Storage Compatiblility Mode
omit 94df20b882 storage_compat_mode: none
omit 22b585da62 [CEP-21] Update tests which require the local node not to 
be joined by default
omit 4873bf13dc more test fixes
omit 29b1f971ad fix UnifiedCompactionStrategyTest
omit 28633375b8 rebase fix
omit 395899a07d Fix ByteBuddyExamplesTest
omit 5e7ed5cbda rebase fixes
omit 98493555a9 [CEP-21] Evict replaced endpoint from gossip
omit 9a425bae50 [CEP-21] Avoid gossip deadlock by grabbing taskLock before 
runInGossipStageBlocking
omit 2943bfd47d [CEP-21] Python dtest fixes * maybe fix hintedhandoff test
omit 54ee755239 [CEP-21] More in-jvm dtest fixes
omit 4f2690d7e2 [CEP-21] Use harry for generating data for coordinator path 
test
omit 8e759dfce9 [CEP-21] Various JVM Dtest fixes
omit b8f8f55d99 [CEP-21] Fix flaky consistentleave test
omit 120d5d049f [CEP-21] Fix assassinate dtests
omit 34e8f3a9bb [CEP-21] Fix MoveTest
omit 19645872d6 [CEP-21] Fix paxos self execution tests
omit 24a722934e [CEP-21] Fix IPMembershipTest
omit 59594c3133 [CEP-21] Fix reprepare tests
omit 6a1565def6 [CEP-21] Reduce number of data harry writes to reduce 
flakiness
omit c8f835c7ce [CEP-21] Fix replacement tests
omit 750339d2c5 [CEP-21] Fix o.a.c.dht.BootstrapperTest
omit 1c90e68550 [CEP-21] Fix o.a.c.service.BootstrapTransientTest
omit 7ba7dbbf54 [CEP-21] Fix o.a.c.db.StreamRequestTest
omit 13ddd1675e [CEP-21] Fix o.a.c.streaming.StreamRateLimiterTest
omit 8ad79e07a3 [CEP-21] Fix o.a.c.tools.TopPartitionsTest
omit b8ec6ce5c0 [CEP-21] Fix 
o.a.c.io.sstable.format.RangeAwareSSTableWriterTest
omit 6fb1d4f2bb [CEP-21] Disable auto metadata snapshots during tests
omit 8e5d352eb1 [CEP-21] Fix o.a.c.tcm.ownership.DeltaMapTest
omit 5916b94039 [CEP-21] Syncronize processing of LocalLog in test code
omit 51a1c7a25c [CEP-21] Fix MockSchema to use supplied keyspace name
omit 1c1c797487 [CEP-21] Fix o.a.c.db.view.ViewUtilsTest
omit 520882ee50 [CEP-21] Fix 
o.a.c.service.reads.repair.[BlockingReadRepairTest|DiagEventsBlockingReadRepairTest]
omit 74e908dfd4 [CEP-21] Restore previous behaviour when fetching effective 
ownership for a local system keyspace
omit 3980032cc2 [CEP-21] Fix o.a.c.db.CleanupTest
omit e0db02c72c [CEP-21] Fix o.a.c.tcm.RemoteProcessorTest
omit d7d937a58e [CEP-21] Remove obsolete 
o.a.c.locator.ReplicationStrategyEndpointCacheTest
omit 2ff6997038 [CEP-21] Fix o.a.c.locator.DynamicEndpointSnitchTest
omit 49de43c39b [CEP-21] Fix o.a.c.locator.ReplicaPlansTest
omit 3f01f96eeb [CEP-21] Fix o.a.c.tcm.transformations.EventsMetadataTest
omit 68ee1de3b4 [CEP-21] Fix o.a.c.tcm.transformations.PrepareLeaveTest
omit f3be304f2e [CEP-21] Fix o.a.c.cql3.KeyCacheCqlTest
omit 663fff7a91 [CEP-21] Remove o.a.c.gms.ExpireEndpointTest.java (CMS 
updates now remove from gossip)
omit 80bee62d3e [CEP-21] Remove o.a.c.gms.PendingRangeCalculatorServiceTest
omit 670de615d2 [CEP-21] Fix o.a.c.db.CleanupTransientTest
omit 0865b9936b [CEP-21] Fix o.a.c.db.ColumnFamilyMetricTest
omit 162b292a10 [CEP-21] Fix o.a.c.db.VerifyTest
omit c16e117b36 [CEP-21] Fix 
o.a.c.db.compaction.writers.CompactionAwareWriterTest
omit 0ab9c0d48f [CEP-21] Remove o.a.c.schema.RemoveWithoutDroppingTest
omit e26e4508ad [CEP-21] Fix o.a.c.schema.SchemaKeyspaceTest
omit d6c3d6c347 [CEP-21] Rewrite o.a.c.service.StorageServiceServerTest
omit 66ab5bad76 [CEP-21] Fix o.a.c.gms.GossiperTest
omit 16a0830881 [CEP-21] Fix o.a.c.tcm.ClusterMetadataTransformationTest
omit 58c97fff0f [CEP-21] Fix o.a.c.tcm.RemoteProcessorTest
omit 54029c3dc5 [CEP-21] Fix o.a.c.service.StorageProxyTest
omit 27c6c8a875 [CEP-21] Additional tests which no longer need to manually 
create system_auth
omit a5dd905907 [CEP-21] Fix o.a.c.service.StorageServiceServerM3PTest
omit 6cbc474851 [CEP-21] Fix o.a.c.service.PartitionDenylistTest
omit c7df550715 [CEP-21] Fix o.a.c.service.JoinTokenRingTest
omit 236d3a2524 [CEP-21] Adjust test for GossipInfo now STATUS is removed
omit a4868f8225 [CEP-21] Tests no longer need to manually create system_auth
omit dca718b05f [CEP-21] Fix o.a.c.tools.StandaloneSplitterWithCQLTesterTest
omit 0724f0666f [CEP-21] Fix o.a.c.tools.JMXCompatibilityTest
omit 6cca495312 [CEP-21] Fix o.a.c.service.reads.range.TokenUpdater
omit 7baf09a8e1 [CEP-21] Fix o.a.c.service.LegacyAuthFailTest
omit 671a3c4554 [CEP-21] Fix o.a.c.db.virtual.StreamingVirtualTableTest
omit 859c06f678 [CEP-21] Fix o.a.c.db.virtual.LocalRepairTablesTest
omit b13b3a43cd [CEP-21] Fix 
o.a.c.db.virtual.JmxPermissionsCacheKeysTableTest
omit 8d5c531e2e [CEP-21] fix

[cassandra-dtest] branch trunk updated: fix audit log archive command test

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

marcuse 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 69bf6794 fix audit log archive command test
69bf6794 is described below

commit 69bf679445eefecae0308405fc8425d71c8ca77e
Author: Marcus Eriksson 
AuthorDate: Tue May 23 09:14:18 2023 +0200

fix audit log archive command test

Patch by marcuse; reviewed by Mick Semb Wever for CASSANDRA-18550
---
 auditlog_test.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/auditlog_test.py b/auditlog_test.py
index 76d022e4..1d1d8c31 100644
--- a/auditlog_test.py
+++ b/auditlog_test.py
@@ -39,7 +39,8 @@ class TestAuditlog(Tester):
 log_dir = tempfile.mkdtemp('logs')
 moved_log_dir, move_script = self._create_script()
 
cluster.set_configuration_options(values={'full_query_logging_options': 
{'log_dir': log_dir,
-   
  'archive_command': 'conf should not be used'}})
+   
  'archive_command': 'conf should not be used',
+   
  'allow_nodetool_archive_command':'true'}})
 cluster.populate(1).start(jvm_args=JVM_ARGS)
 node = cluster.nodelist()[0]
 node.nodetool("enablefullquerylog --archive-command \"%s %%path\" 
--roll-cycle=TEST_SECONDLY"%move_script)


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



[cassandra] branch trunk updated (2dc1639d4f -> f36fd33e33)

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

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


from 2dc1639d4f Merge branch 'cassandra-4.1' into trunk
 new aafb4d1944 Improve nodetool enable{audit,fullquery}log
 new 72fc04d238 Merge branch 'cassandra-4.0' into cassandra-4.1
 new f36fd33e33 Merge branch 'cassandra-4.1' 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:
 CHANGES.txt|  1 +
 conf/cassandra.yaml|  2 ++
 .../cassandra/config/DatabaseDescriptor.java   |  5 
 .../apache/cassandra/service/StorageService.java   |  8 +-
 .../cassandra/tools/nodetool/EnableAuditLog.java   |  4 ++-
 .../tools/nodetool/EnableFullQueryLog.java |  3 ++-
 .../cassandra/utils/binlog/BinLogOptions.java  |  7 ++
 .../apache/cassandra/audit/AuditLoggerTest.java| 29 ++
 .../apache/cassandra/fql/FullQueryLoggerTest.java  | 27 
 9 files changed, 83 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-4.1 updated (93efe0ee04 -> 72fc04d238)

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

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


from 93efe0ee04 Merge branch 'cassandra-4.0' into cassandra-4.1
 new aafb4d1944 Improve nodetool enable{audit,fullquery}log
 new 72fc04d238 Merge branch 'cassandra-4.0' into cassandra-4.1

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:
 CHANGES.txt|  1 +
 conf/cassandra.yaml|  2 ++
 .../cassandra/config/DatabaseDescriptor.java   |  5 
 .../apache/cassandra/service/StorageService.java   |  8 +-
 .../cassandra/tools/nodetool/EnableAuditLog.java   |  4 ++-
 .../tools/nodetool/EnableFullQueryLog.java |  3 ++-
 .../cassandra/utils/binlog/BinLogOptions.java  |  7 ++
 .../apache/cassandra/audit/AuditLoggerTest.java| 29 ++
 .../apache/cassandra/fql/FullQueryLoggerTest.java  | 27 
 9 files changed, 83 insertions(+), 3 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.1' into trunk

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

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

commit f36fd33e33ff88e07fdb5e3c5df7385d3fa8d688
Merge: 2dc1639d4f 72fc04d238
Author: Marcus Eriksson 
AuthorDate: Thu May 25 08:43:27 2023 +0200

Merge branch 'cassandra-4.1' into trunk

 CHANGES.txt|  1 +
 conf/cassandra.yaml|  2 ++
 .../cassandra/config/DatabaseDescriptor.java   |  5 
 .../apache/cassandra/service/StorageService.java   |  8 +-
 .../cassandra/tools/nodetool/EnableAuditLog.java   |  4 ++-
 .../tools/nodetool/EnableFullQueryLog.java |  3 ++-
 .../cassandra/utils/binlog/BinLogOptions.java  |  7 ++
 .../apache/cassandra/audit/AuditLoggerTest.java| 29 ++
 .../apache/cassandra/fql/FullQueryLoggerTest.java  | 27 
 9 files changed, 83 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-4.0 updated: Improve nodetool enable{audit,fullquery}log

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

marcuse 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 aafb4d1944 Improve nodetool enable{audit,fullquery}log
aafb4d1944 is described below

commit aafb4d19448f12ce600dc4e84a5b181308825b32
Author: Marcus Eriksson 
AuthorDate: Wed Apr 12 09:17:50 2023 +0200

Improve nodetool enable{audit,fullquery}log

Patch by marcuse; reviewed by Dinesh Joshi and Mick Semb Wever for 
CASSANDRA-18550
---
 CHANGES.txt|  1 +
 conf/cassandra.yaml|  2 ++
 .../cassandra/config/DatabaseDescriptor.java   |  5 
 .../apache/cassandra/service/StorageService.java   |  2 ++
 .../tools/nodetool/EnableFullQueryLog.java |  3 ++-
 .../cassandra/utils/binlog/BinLogOptions.java  |  7 ++
 .../apache/cassandra/fql/FullQueryLoggerTest.java  | 28 +-
 7 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index b057a07f2a..4f873aa71c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.10
+ * Improve nodetool enable{audit,fullquery}log (CASSANDRA-18550)
  * Report network cache info in nodetool (CASSANDRa-18400)
  * Partial compaction can resurrect deleted data (CASSANDRA-18507)
  * Allow internal address to change with reconnecting snitches 
(CASSANDRA-16718)
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 1b0871fcf1..3e4da52f5f 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -1360,6 +1360,8 @@ audit_logging_options:
 # max_log_size: 17179869184 # 16 GiB
 ## archive command is "/path/to/script.sh %path" where %path is replaced 
with the file being rolled:
 # archive_command:
+## note that enabling this allows anyone with JMX/nodetool access to run 
local shell commands as the user running cassandra
+# allow_nodetool_archive_command: false
 # max_archive_retries: 10
 
 # validate tombstones on reads and compaction
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index f78a5b668a..8893f58e56 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -3140,6 +3140,11 @@ public class DatabaseDescriptor
 return  conf.full_query_logging_options;
 }
 
+public static void setFullQueryLogOptions(FullQueryLoggerOptions options)
+{
+conf.full_query_logging_options = options;
+}
+
 public static boolean getBlockForPeersInRemoteDatacenters()
 {
 return conf.block_for_peers_in_remote_dcs;
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index 6a02b405af..b53467e81b 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -6081,6 +6081,8 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 blocking = blocking != null ? blocking : fqlOptions.block;
 maxQueueWeight = maxQueueWeight != Integer.MIN_VALUE ? maxQueueWeight 
: fqlOptions.max_queue_weight;
 maxLogSize = maxLogSize != Long.MIN_VALUE ? maxLogSize : 
fqlOptions.max_log_size;
+if (archiveCommand != null && 
!fqlOptions.allow_nodetool_archive_command)
+throw new ConfigurationException("Can't enable full query log 
archiving via nodetool unless 
full_query_logging_options.allow_nodetool_archive_command is set to true");
 archiveCommand = archiveCommand != null ? archiveCommand : 
fqlOptions.archive_command;
 maxArchiveRetries = maxArchiveRetries != Integer.MIN_VALUE ? 
maxArchiveRetries : fqlOptions.max_archive_retries;
 
diff --git 
a/src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java 
b/src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java
index 9873e5a01a..d78d5ae80f 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/EnableFullQueryLog.java
@@ -42,7 +42,8 @@ public class EnableFullQueryLog extends NodeToolCmd
 private String path = null;
 
 @Option(title = "archive_command", name = {"--archive-command"}, 
description = "Command that will handle archiving rolled full query log files." 
+
-   
" Format is \"/path/to/script.sh %path\" where %path will be replaced with 
the file to archive")
+   
" Format is 

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

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

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

commit 72fc04d238dbdece34ba6f922b431beb1b14ec7d
Merge: 93efe0ee04 aafb4d1944
Author: Marcus Eriksson 
AuthorDate: Thu May 25 08:42:30 2023 +0200

Merge branch 'cassandra-4.0' into cassandra-4.1

 CHANGES.txt|  1 +
 conf/cassandra.yaml|  2 ++
 .../cassandra/config/DatabaseDescriptor.java   |  5 
 .../apache/cassandra/service/StorageService.java   |  8 +-
 .../cassandra/tools/nodetool/EnableAuditLog.java   |  4 ++-
 .../tools/nodetool/EnableFullQueryLog.java |  3 ++-
 .../cassandra/utils/binlog/BinLogOptions.java  |  7 ++
 .../apache/cassandra/audit/AuditLoggerTest.java| 29 ++
 .../apache/cassandra/fql/FullQueryLoggerTest.java  | 27 
 9 files changed, 83 insertions(+), 3 deletions(-)

diff --cc CHANGES.txt
index 0f46880950,4f873aa71c..302ac8b936
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,11 -1,5 +1,12 @@@
 -4.0.10
 +4.1.2
 + * Allow keystore and trustrore passwords to be nullable (CASSANDRA-18124)
 + * Return snapshots with dots in their name in nodetool listsnapshots 
(CASSANDRA-18371)
 + * Fix NPE when loading snapshots and data directory is one directory from 
root (CASSANDRA-18359)
 + * Do not submit hints when hinted_handoff_enabled=false (CASSANDRA-18304)
 + * Fix COPY ... TO STDOUT behavior in cqlsh (CASSANDRA-18353)
 + * Remove six and Py2SaferScanner merge cruft (CASSANDRA-18354)
 +Merged from 4.0:
+  * Improve nodetool enable{audit,fullquery}log (CASSANDRA-18550)
   * Report network cache info in nodetool (CASSANDRa-18400)
   * Partial compaction can resurrect deleted data (CASSANDRA-18507)
   * Allow internal address to change with reconnecting snitches 
(CASSANDRA-16718)
diff --cc conf/cassandra.yaml
index a15de953c0,3e4da52f5f..4b2711cfb7
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@@ -1580,15 -1352,17 +1580,17 @@@ audit_logging_options
  
  # default options for full query logging - these can be overridden from 
command line when executing
  # nodetool enablefullquerylog
 -#full_query_logging_options:
 -# log_dir:
 -# roll_cycle: HOURLY
 -# block: true
 -# max_queue_weight: 268435456 # 256 MiB
 -# max_log_size: 17179869184 # 16 GiB
 -## archive command is "/path/to/script.sh %path" where %path is replaced 
with the file being rolled:
 -# archive_command:
 -## note that enabling this allows anyone with JMX/nodetool access to run 
local shell commands as the user running cassandra
 -# allow_nodetool_archive_command: false
 -# max_archive_retries: 10
 +# full_query_logging_options:
 +  # log_dir:
 +  # roll_cycle: HOURLY
 +  # block: true
 +  # max_queue_weight: 268435456 # 256 MiB
 +  # max_log_size: 17179869184 # 16 GiB
 +  ## archive command is "/path/to/script.sh %path" where %path is replaced 
with the file being rolled:
 +  # archive_command:
++  ## note that enabling this allows anyone with JMX/nodetool access to run 
local shell commands as the user running cassandra
++  # allow_nodetool_archive_command: false
 +  # max_archive_retries: 10
  
  # validate tombstones on reads and compaction
  # can be either "disabled", "warn" or "exception"
diff --cc src/java/org/apache/cassandra/service/StorageService.java
index 87cfbac046,b53467e81b..ed10f04773
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@@ -6390,33 -5998,29 +6390,37 @@@ public class StorageService extends Not
  public void enableAuditLog(String loggerName, Map 
parameters, String includedKeyspaces, String excludedKeyspaces, String 
includedCategories, String excludedCategories,
 String includedUsers, String excludedUsers) 
throws ConfigurationException, IllegalStateException
  {
 -loggerName = loggerName != null ? loggerName : 
DatabaseDescriptor.getAuditLoggingOptions().logger.class_name;
 -
 -Preconditions.checkNotNull(loggerName, "cassandra.yaml did not have 
logger in audit_logging_option and not set as parameter");
 -
Preconditions.checkState(FBUtilities.isAuditLoggerClassExists(loggerName), 
"Unable to find AuditLogger class: "+loggerName);
 -
 -AuditLogOptions auditLogOptions = new AuditLogOptions();
 -auditLogOptions.enabled = true;
 -auditLogOptions.logger = new ParameterizedClass(loggerName, 
parameters);
 -auditLogOptions.included_keyspaces = includedKeyspaces != null ? 
includedKeyspaces : 
DatabaseDescriptor.getAuditLoggingOptions().included_keyspaces;
 -auditLogOptions.excluded_keyspaces = excludedKeyspaces != null ? 
excludedKeyspaces : 
DatabaseDescriptor.getAuditLoggingOptio

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

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 7ecbad7ee846bf2648e2a91d8628f11ce95daece
Merge: 69982767e5 fabc6e7c7b
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 15:00:54 2022 +0100

Merge branch 'cassandra-4.1' into trunk

 CHANGES.txt | 1 +
 .../apache/cassandra/db/compaction/DateTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java| 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --cc CHANGES.txt
index 45dbfba0f3,ad78142df5..fd5f31153c
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,100 -1,24 +1,101 @@@
 -4.1.1
 -Merged from 4.0:
 +4.2
 + * Add Mutation Serialization Caching (CASSANDRA-17998)
 + * Only reload compaction strategies if disk boundaries change 
(CASSANDRA-17874)
 + * CEP-10: Simulator Java11 Support (CASSANDRA-17178)
 + * Set the major compaction type correctly for compactionstats 
(CASSANDRA-18055)
 + * Print exception message without stacktrace when nodetool commands fail on 
probe.getOwnershipWithPort() (CASSANDRA-18079)
 + * Add option to print level in nodetool getsstables output (CASSANDRA-18023)
 + * Implement a guardrail for not having zero default_time_to_live on tables 
with TWCS (CASSANDRA-18042)
 + * Add CQL scalar functions for collection aggregation (CASSANDRA-18060)
 + * Make cassandra.replayList property for CommitLogReplayer possible to react 
on keyspaces only (CASSANDRA-18044)
 + * Add Mathematical functions (CASSANDRA-17221)
 + * Make incremental backup configurable per table (CASSANDRA-15402)
 + * Change shebangs of Python scripts to resolve Python 3 from env command 
(CASSANDRA-17832)
 + * Add reasons to guardrail messages and consider guardrails in the error 
message for needed ALLOW FILTERING (CASSANDRA-17967)
 + * Add support for CQL functions on collections, tuples and UDTs 
(CASSANDRA-17811)
 + * Add flag to exclude nodes from local DC when running nodetool rebuild 
(CASSANDRA-17870)
 + * Adding endpoint verification option to client_encryption_options 
(CASSANDRA-18034)
 + * Replace 'wcwidth.py' with pypi module (CASSANDRA-17287)
 + * Add nodetool forcecompact to remove tombstoned or ttl'd data ignoring GC 
grace for given table and partition keys (CASSANDRA-17711)
 + * Offer IF (NOT) EXISTS in cqlsh completion for CREATE TYPE, DROP TYPE, 
CREATE ROLE and DROP ROLE (CASSANDRA-16640)
 + * Nodetool bootstrap resume will now return an error if the operation fails 
(CASSANDRA-16491)
 + * Disable resumable bootstrap by default (CASSANDRA-17679)
 + * Include Git SHA in --verbose flag for nodetool version (CASSANDRA-17753)
 + * Update Byteman to 4.0.20 and Jacoco to 0.8.8 (CASSANDRA-16413)
 + * Add memtable option among possible tab completions for a table 
(CASSANDRA-17982)
 + * Adds a trie-based memtable implementation (CASSANDRA-17240)
 + * Further improves precision of memtable heap tracking (CASSANDRA-17240)
 + * Fix formatting of metrics documentation (CASSANDRA-17961)
 + * Keep sstable level when streaming for decommission and move 
(CASSANDRA-17969)
 + * Add Unavailables metric for CASWrite in the docs (CASSANDRA-16357)
 + * Make Cassandra logs able to be viewed in the virtual table 
system_views.system_logs (CASSANDRA-17946)
 + * IllegalArgumentException in Gossiper#order due to concurrent mutations to 
elements being applied (CASSANDRA-17908)
 + * Include estimated active compaction remaining write size when starting a 
new compaction (CASSANDRA-17931)
 + * Mixed mode support for internode authentication during TLS upgrades 
(CASSANDRA-17923)
 + * Revert Mockito downgrade from CASSANDRA-17750 (CASSANDRA-17496)
 + * Add --older-than and --older-than-timestamp options for nodetool 
clearsnapshots (CASSANDRA-16860)
 + * Fix "open RT bound as its last item" exception (CASSANDRA-17810)
 + * Fix leak of non-standard Java types in JMX MBeans 
`org.apache.cassandra.db:type=StorageService`
 +   and `org.apache.cassandra.db:type=RepairService` as clients using JMX 
cannot handle them. More details in NEWS.txt (CASSANDRA-17668)
 + * Deprecate Throwables.propagate usage (CASSANDRA-14218)
 + * Allow disabling hotness persistence for high sstable counts 
(CASSANDRA-17868)
 + * Prevent NullPointerException when changing neverPurgeTombstones from true 
to false (CASSANDRA-17897)
 + * Add metrics around storage usage and compression (CASSANDRA-17898)
 + * Remove usage of deprecated javax certificate classes (CASSANDRA-17867)
 + * Make sure preview repairs don't optimise streams unless configured to 
(CASSANDRA-17865)
 + * Optionally avoid hint transfer during decommission (CASSANDRA-17808)
 + * Make disabling auto snapshot on selected tables possible (CASSANDRA-10383)
 + * Introduce compaction priorities to prevent upgrade 

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

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit fabc6e7c7b1ceee21408fdb15822370042339e28
Merge: 203c61abaf ee266d283e
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 14:59:59 2022 +0100

Merge branch 'cassandra-4.0' into cassandra-4.1

 CHANGES.txt | 1 +
 .../apache/cassandra/db/compaction/DateTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java| 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --cc CHANGES.txt
index e5c97ddb54,b9ab8981ec..ad78142df5
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,7 -1,12 +1,8 @@@
 -4.0.8
 +4.1.1
 +Merged from 4.0:
+  * Avoid ConcurrentModificationException in STCS/DTCS/TWCS.getSSTables 
(CASSANDRA-17977)
   * Restore internode custom tracing on 4.0's new messaging system 
(CASSANDRA-17981)
 - * Harden parsing of boolean values in CQL in PropertyDefinitions 
(CASSANDRA-17878)
 - * Fix error message about type hints (CASSANDRA-17915)
 - * Fix possible race condition on repair snapshots (CASSANDRA-17955)
 - * Fix ASM bytecode version inconsistency (CASSANDRA-17873)
  Merged from 3.11:
 - * Fix Splitter sometimes creating more splits than requested 
(CASSANDRA-18013)
  Merged from 3.0:
   * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
   * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)


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



[cassandra] branch cassandra-4.1 updated (203c61abaf -> fabc6e7c7b)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 203c61abaf Merge branch 'cassandra-4.0' into cassandra-4.1
 new ee266d283e Avoid ConcurrentModificationException in 
STCS/DTCS/TWCS.getSSTables
 new fabc6e7c7b Merge branch 'cassandra-4.0' into cassandra-4.1

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:
 CHANGES.txt | 1 +
 .../apache/cassandra/db/compaction/DateTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java| 2 +-
 4 files changed, 4 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 (69982767e5 -> 7ecbad7ee8)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 69982767e5 Merge branch 'cassandra-4.1' into trunk
 new ee266d283e Avoid ConcurrentModificationException in 
STCS/DTCS/TWCS.getSSTables
 new fabc6e7c7b Merge branch 'cassandra-4.0' into cassandra-4.1
 new 7ecbad7ee8 Merge branch 'cassandra-4.1' 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:
 CHANGES.txt | 1 +
 .../apache/cassandra/db/compaction/DateTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java| 2 +-
 4 files changed, 4 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-4.0 updated: Avoid ConcurrentModificationException in STCS/DTCS/TWCS.getSSTables

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 ee266d283e Avoid ConcurrentModificationException in 
STCS/DTCS/TWCS.getSSTables
ee266d283e is described below

commit ee266d283e740785817d7cb6749e6c135f4aacbb
Author: Marcus Eriksson 
AuthorDate: Thu Oct 20 08:18:06 2022 +0200

Avoid ConcurrentModificationException in STCS/DTCS/TWCS.getSSTables

Patch by marcuse; reviewed by Aleksey Yeschenko for CASSANDRA-17977
---
 CHANGES.txt | 1 +
 .../apache/cassandra/db/compaction/DateTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java| 2 +-
 .../apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java| 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index f737b1..b9ab8981ec 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.8
+ * Avoid ConcurrentModificationException in STCS/DTCS/TWCS.getSSTables 
(CASSANDRA-17977)
  * Restore internode custom tracing on 4.0's new messaging system 
(CASSANDRA-17981)
  * Harden parsing of boolean values in CQL in PropertyDefinitions 
(CASSANDRA-17878)
  * Fix error message about type hints (CASSANDRA-17915)
diff --git 
a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java 
b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
index ab2b6ae328..a94bcfa59e 100644
--- 
a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
@@ -236,7 +236,7 @@ public class DateTieredCompactionStrategy extends 
AbstractCompactionStrategy
 }
 
 @Override
-protected Set getSSTables()
+protected synchronized Set getSSTables()
 {
 return ImmutableSet.copyOf(sstables);
 }
diff --git 
a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java 
b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index 8d1d8dac2e..7a63a1e8e5 100644
--- 
a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -336,7 +336,7 @@ public class SizeTieredCompactionStrategy extends 
AbstractCompactionStrategy
 }
 
 @Override
-protected Set getSSTables()
+protected synchronized Set getSSTables()
 {
 return ImmutableSet.copyOf(sstables);
 }
diff --git 
a/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java 
b/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
index eb547db587..4b499ce478 100644
--- 
a/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
@@ -196,7 +196,7 @@ public class TimeWindowCompactionStrategy extends 
AbstractCompactionStrategy
 }
 
 @Override
-protected Set getSSTables()
+protected synchronized Set getSSTables()
 {
 return ImmutableSet.copyOf(sstables);
 }


-
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

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 0767c834162d74bdc857f47615b9e8a5c7e76d5b
Merge: baa9d0327f 730b898b74
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 14:41:50 2022 +0100

Merge branch 'cassandra-3.0' into cassandra-3.11

 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 
 test/unit/org/apache/cassandra/MockSchema.java | 19 
 .../TimeWindowCompactionStrategyTest.java  | 25 +-
 4 files changed, 54 insertions(+), 5 deletions(-)

diff --cc CHANGES.txt
index ad25802839,3900ab5b58..ee21b34ebc
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,7 -1,5 +1,8 @@@
 -3.0.29
 +3.11.15
 + * Fix Splitter sometimes creating more splits than requested 
(CASSANDRA-18013)
 +
 +Merged from 3.0:
+  * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
   * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)
   * Fix incorrect resource name in LIST PERMISSION output (CASSANDRA-17848)
   * Suppress CVE-2022-41854 and similar (CASSANDRA-18083)
diff --cc 
src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
index 74e5f9d95a,5ae1cc784c..bbc9cdf8ee
--- 
a/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
@@@ -376,9 -333,23 +376,23 @@@ public class TimeWindowCompactionStrate
  LifecycleTransaction txn = 
cfs.getTracker().tryModify(filteredSSTables, OperationType.COMPACTION);
  if (txn == null)
  return null;
 -return Collections.singleton(new CompactionTask(cfs, txn, gcBefore));
 +return Collections.singleton(new TimeWindowCompactionTask(cfs, txn, 
gcBefore, options.ignoreOverlaps));
  }
  
+ /**
+  * TWCS should not group sstables for anticompaction - this can mix new 
and old data
+  */
+ @Override
+ public Collection> 
groupSSTablesForAntiCompaction(Collection sstablesToGroup)
+ {
+ Collection> groups = new 
ArrayList<>(sstablesToGroup.size());
+ for (SSTableReader sstable : sstablesToGroup)
+ {
+ groups.add(Collections.singleton(sstable));
+ }
+ return groups;
+ }
+ 
  @Override
  @SuppressWarnings("resource") // transaction is closed by 
AbstractCompactionTask::execute
  public synchronized AbstractCompactionTask 
getUserDefinedTask(Collection sstables, int gcBefore)
diff --cc test/unit/org/apache/cassandra/MockSchema.java
index 2b480d8e3c,5f3198dad0..90c8e4c705
--- a/test/unit/org/apache/cassandra/MockSchema.java
+++ b/test/unit/org/apache/cassandra/MockSchema.java
@@@ -85,27 -86,18 +85,37 @@@ public class MockSchem
  return sstable(generation, size, false, cfs);
  }
  
 +public static SSTableReader sstable(int generation, int size, boolean 
keepRef, ColumnFamilyStore cfs)
 +{
 +return sstable(generation, size, keepRef, generation, generation, 
cfs);
 +}
 +
 +public static SSTableReader sstableWithLevel(int generation, long 
firstToken, long lastToken, int level, ColumnFamilyStore cfs)
 +{
 +return sstable(generation, 0, false, firstToken, lastToken, level, 
cfs);
 +}
 +
 +public static SSTableReader sstableWithLevel(int generation, int size, 
int level, ColumnFamilyStore cfs)
 +{
 +return sstable(generation, size, false, generation, generation, 
level, cfs);
 +}
 +
+ public static SSTableReader sstableWithTimestamp(int generation, long 
timestamp, ColumnFamilyStore cfs)
+ {
 -return sstable(generation, 0, false, timestamp, cfs);
++return sstable(generation, 0, false, 0, 1000, 0, Integer.MAX_VALUE, 
timestamp, cfs);
+ }
+ 
 -public static SSTableReader sstable(int generation, int size, boolean 
keepRef, ColumnFamilyStore cfs)
 +public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long firstToken, long lastToken, ColumnFamilyStore cfs)
  {
 -return sstable(generation, size, keepRef, System.currentTimeMillis() 
* 1000, cfs);
 +return sstable(generation, size, keepRef, firstToken, lastToken, 0, 
cfs);
  }
  
 +public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long firstToken, long lastToken, int level, ColumnFamilyStore cfs)
++{
++return sstable(generation, size, keepRef, firstToken, lastToken, 
level, Integer.MAX_VALUE, System.currentTimeMillis() * 1000, cfs);
++}
+ 
 -public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long timestamp, ColumnFamilyStore cfs)
++public static SSTableReader sstable(int generation, int size, boolean 
ke

[cassandra] branch cassandra-4.0 updated (ace3920239 -> 95e26ad1ab)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from ace3920239 Merge branch 'cassandra-3.11' into cassandra-4.0
 new 730b898b74 Don't group TWCS sstables for anticompaction
 new 0767c83416 Merge branch 'cassandra-3.0' into cassandra-3.11
 new 95e26ad1ab 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:
 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 19 +
 4 files changed, 54 insertions(+), 4 deletions(-)


-
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: Don't group TWCS sstables for anticompaction

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 730b898b74 Don't group TWCS sstables for anticompaction
730b898b74 is described below

commit 730b898b7415e568138c6fc1e961f69b41ba1fa0
Author: Marcus Eriksson 
AuthorDate: Tue Oct 18 12:57:07 2022 +0200

Don't group TWCS sstables for anticompaction

Patch by marcuse; reviewed by Aleksey Yeschenko for CASSANDRA-17970
---
 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 test/unit/org/apache/cassandra/MockSchema.java | 23 +++---
 .../TimeWindowCompactionStrategyTest.java  | 23 ++
 4 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 98d1cb1e04..3900ab5b58 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.29
+ * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
  * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)
  * Fix incorrect resource name in LIST PERMISSION output (CASSANDRA-17848)
  * Suppress CVE-2022-41854 and similar (CASSANDRA-18083)
diff --git 
a/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java 
b/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
index c44d3aa980..5ae1cc784c 100644
--- 
a/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategy.java
@@ -336,6 +336,20 @@ public class TimeWindowCompactionStrategy extends 
AbstractCompactionStrategy
 return Collections.singleton(new CompactionTask(cfs, txn, gcBefore));
 }
 
+/**
+ * TWCS should not group sstables for anticompaction - this can mix new 
and old data
+ */
+@Override
+public Collection> 
groupSSTablesForAntiCompaction(Collection sstablesToGroup)
+{
+Collection> groups = new 
ArrayList<>(sstablesToGroup.size());
+for (SSTableReader sstable : sstablesToGroup)
+{
+groups.add(Collections.singleton(sstable));
+}
+return groups;
+}
+
 @Override
 @SuppressWarnings("resource") // transaction is closed by 
AbstractCompactionTask::execute
 public synchronized AbstractCompactionTask 
getUserDefinedTask(Collection sstables, int gcBefore)
diff --git a/test/unit/org/apache/cassandra/MockSchema.java 
b/test/unit/org/apache/cassandra/MockSchema.java
index 1b47fc22ff..5f3198dad0 100644
--- a/test/unit/org/apache/cassandra/MockSchema.java
+++ b/test/unit/org/apache/cassandra/MockSchema.java
@@ -50,6 +50,8 @@ import org.apache.cassandra.schema.KeyspaceParams;
 import org.apache.cassandra.utils.AlwaysPresentFilter;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
+import static 
org.apache.cassandra.service.ActiveRepairService.UNREPAIRED_SSTABLE;
+
 public class MockSchema
 {
 static
@@ -84,7 +86,18 @@ public class MockSchema
 return sstable(generation, size, false, cfs);
 }
 
+public static SSTableReader sstableWithTimestamp(int generation, long 
timestamp, ColumnFamilyStore cfs)
+{
+return sstable(generation, 0, false, timestamp, cfs);
+}
+
 public static SSTableReader sstable(int generation, int size, boolean 
keepRef, ColumnFamilyStore cfs)
+{
+return sstable(generation, size, keepRef, System.currentTimeMillis() * 
1000, cfs);
+}
+
+
+public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long timestamp, ColumnFamilyStore cfs)
 {
 Descriptor descriptor = new 
Descriptor(cfs.getDirectories().getDirectoryForNewSSTables(),
cfs.keyspace.getName(),
@@ -119,9 +132,13 @@ public class MockSchema
 }
 }
 SerializationHeader header = SerializationHeader.make(cfs.metadata, 
Collections.emptyList());
-StatsMetadata metadata = (StatsMetadata) new 
MetadataCollector(cfs.metadata.comparator)
- 
.finalizeMetadata(cfs.metadata.partitioner.getClass().getCanonicalName(), 
0.01f, -1, header)
- .get(MetadataType.STATS);
+MetadataCollector collector = new 
MetadataCollector(cfs.metadata.comparator);
+collector.update(new DeletionTime(timestamp, (int) 
(System.currentTimeMillis() / 1000)));
+StatsMetadata metadata = (StatsMetadata) 
collector.finalizeMetadata(cfs.metadata.partitioner.getClass().getCanonicalName(),
+

[cassandra] branch cassandra-4.1 updated (97f9ff7da3 -> 203c61abaf)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 97f9ff7da3 Merge branch 'cassandra-4.0' into cassandra-4.1
 new 730b898b74 Don't group TWCS sstables for anticompaction
 new 0767c83416 Merge branch 'cassandra-3.0' into cassandra-3.11
 new 95e26ad1ab Merge branch 'cassandra-3.11' into cassandra-4.0
 new 203c61abaf Merge branch 'cassandra-4.0' into cassandra-4.1

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:
 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 19 +
 4 files changed, 54 insertions(+), 4 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 cassandra-4.1

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 203c61abaf0a85ce6c9faa207987494ff5ce1338
Merge: 97f9ff7da3 95e26ad1ab
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 14:44:19 2022 +0100

Merge branch 'cassandra-4.0' into cassandra-4.1

 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 19 +
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --cc CHANGES.txt
index 16ed8a33c2,f737b1..e5c97ddb54
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,31 -1,19 +1,32 @@@
 -4.0.8
 +4.1.1
 +Merged from 4.0:
   * Restore internode custom tracing on 4.0's new messaging system 
(CASSANDRA-17981)
 - * Harden parsing of boolean values in CQL in PropertyDefinitions 
(CASSANDRA-17878)
 - * Fix error message about type hints (CASSANDRA-17915)
 - * Fix possible race condition on repair snapshots (CASSANDRA-17955)
 - * Fix ASM bytecode version inconsistency (CASSANDRA-17873)
  Merged from 3.11:
 - * Fix Splitter sometimes creating more splits than requested 
(CASSANDRA-18013)
  Merged from 3.0:
+  * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
   * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)
 +
 +4.1.0
 + * Fix ContentionStrategy backoff and Clock.waitUntil (CASSANDRA-18086)
 +Merged from 4.0:
 +Merged from 3.11:
 +Merged from 3.0:
   * Fix incorrect resource name in LIST PERMISSION output (CASSANDRA-17848)
   * Suppress CVE-2022-41854 and similar (CASSANDRA-18083)
 - * Fix running Ant rat targets without git (CASSANDRA-17974)
  
 -4.0.7
 +
 +4.1-rc1
 + * Avoid schema mismatch problems on memtable API misconfiguration 
(CASSANDRA-18040)
 + * Start Paxos auto repair in CassandraDaemon (CASSANDRA-18029)
 + * Restore streaming_keep_alive_period on the netty control streaming channel 
(CASSANDRA-17768)
 + * Move Schema.FORCE_LOAD_KEYSPACES and Schema.FORCE_LOAD_KEYSPACES_PROP to 
CassandraRelevantProps (CASSANDRA-17783)
 + * Add --resolve-ip option to nodetool gossipinfo (CASSANDRA-17934)
 + * Allow pre-V5 global limit on bytes in flight to revert to zero 
asynchronously in RateLimitingTest (CASSANDRA-17927)
 +Merged from 4.0:
 + * Harden parsing of boolean values in CQL in PropertyDefinitions 
(CASSANDRA-17878)
 + * Fix error message about type hints (CASSANDRA-17915)
 + * Fix possible race condition on repair snapshots (CASSANDRA-17955)
 + * Fix ASM bytecode version inconsistency (CASSANDRA-17873)
   * Remove empty cq4 files in log directory to not fail the startup of BinLog 
(CASSANDRA-17933)
   * Fix multiple BufferPool bugs (CASSANDRA-16681)
   * Fix StorageService.getNativeaddress handling of IPv6 addresses 
(CASSANDRA-17945)


-
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.1' into trunk

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 69982767e571abf8b414ac2f13a29d1cb0c7fef8
Merge: b171b4ba29 203c61abaf
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 14:45:48 2022 +0100

Merge branch 'cassandra-4.1' into trunk

 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 14 +
 4 files changed, 49 insertions(+), 4 deletions(-)

diff --cc CHANGES.txt
index ec620e06db,e5c97ddb54..45dbfba0f3
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -165,13 -97,6 +165,14 @@@ Merged from 3.11
   * Creating of a keyspace on insufficient number of replicas should filter 
out gosspping-only members (CASSANDRA-17759)
   * Suppress CVE-2022-25857 and other snakeyaml CVEs (CASSANDRA-17907)
  Merged from 3.0:
++ * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
 + * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)
 + * Fix incorrect resource name in LIST PERMISSION output (CASSANDRA-17848)
 + * Suppress CVE-2022-41854 and similar (CASSANDRA-18083)
 + * Fix running Ant rat targets without git (CASSANDRA-17974)
 + * Harden JMX by resolving beanshooter issues (CASSANDRA-17921)
 + * Suppress CVE-2019-2684 (CASSANDRA-17965)
 + * Fix auto-completing "WITH" when creating a materialized view 
(CASSANDRA-17879)
   * Improve libjemalloc resolution in bin/cassandra (CASSANDRA-15767)
   * Fix restarting of services on gossipping-only member (CASSANDRA-17752)
   * Fix scrubber falling into infinite loop when the last partition is broken 
(CASSANDRA-17862)
diff --cc test/unit/org/apache/cassandra/schema/MockSchema.java
index 853c0b53e0,f5c9986c9e..691abede2a
--- a/test/unit/org/apache/cassandra/schema/MockSchema.java
+++ b/test/unit/org/apache/cassandra/schema/MockSchema.java
@@@ -131,9 -126,9 +131,14 @@@ public class MockSchem
  return sstable(generation, size, false, generation, generation, 
level, cfs);
  }
  
+ public static SSTableReader sstableWithTimestamp(int generation, long 
timestamp, ColumnFamilyStore cfs)
+ {
 -return sstable(generation, 0, false, 0, 1000, 0, Integer.MAX_VALUE, 
timestamp, cfs);
++return sstable(generation, 0, false, 0, 1000, 0, cfs, 
Integer.MAX_VALUE, timestamp);
++}
++
 +public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long firstToken, long lastToken, int level, ColumnFamilyStore cfs)
 +{
 +return sstable(generation, size, keepRef, firstToken, lastToken, 
level, cfs, Integer.MAX_VALUE);
  }
  
  public static SSTableReader sstable(int generation, int size, boolean 
keepRef, long firstToken, long lastToken, ColumnFamilyStore cfs)


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



[cassandra] branch trunk updated (b171b4ba29 -> 69982767e5)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from b171b4ba29 Merge branch 'cassandra-4.1' into trunk
 new 730b898b74 Don't group TWCS sstables for anticompaction
 new 0767c83416 Merge branch 'cassandra-3.0' into cassandra-3.11
 new 95e26ad1ab Merge branch 'cassandra-3.11' into cassandra-4.0
 new 203c61abaf Merge branch 'cassandra-4.0' into cassandra-4.1
 new 69982767e5 Merge branch 'cassandra-4.1' into trunk

The 5 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:
 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 14 +
 4 files changed, 49 insertions(+), 4 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 (baa9d0327f -> 0767c83416)

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from baa9d0327f Merge branch 'cassandra-3.0' into cassandra-3.11
 new 730b898b74 Don't group TWCS sstables for anticompaction
 new 0767c83416 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:
 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 
 test/unit/org/apache/cassandra/MockSchema.java | 19 
 .../TimeWindowCompactionStrategyTest.java  | 25 +-
 4 files changed, 54 insertions(+), 5 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-3.11' into cassandra-4.0

2022-12-23 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 95e26ad1ab29b52e720edf9792eba100817cce9d
Merge: ace3920239 0767c83416
Author: Marcus Eriksson 
AuthorDate: Fri Dec 23 14:43:01 2022 +0100

Merge branch 'cassandra-3.11' into cassandra-4.0

 CHANGES.txt|  1 +
 .../compaction/TimeWindowCompactionStrategy.java   | 14 +
 .../TimeWindowCompactionStrategyTest.java  | 24 ++
 .../org/apache/cassandra/schema/MockSchema.java| 19 +
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --cc CHANGES.txt
index 1cb2280828,ee21b34ebc..f737b1
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,8 +1,13 @@@
 -3.11.15
 +4.0.8
 + * Restore internode custom tracing on 4.0's new messaging system 
(CASSANDRA-17981)
 + * Harden parsing of boolean values in CQL in PropertyDefinitions 
(CASSANDRA-17878)
 + * Fix error message about type hints (CASSANDRA-17915)
 + * Fix possible race condition on repair snapshots (CASSANDRA-17955)
 + * Fix ASM bytecode version inconsistency (CASSANDRA-17873)
 +Merged from 3.11:
   * Fix Splitter sometimes creating more splits than requested 
(CASSANDRA-18013)
 -
  Merged from 3.0:
+  * Avoid anticompaction mixing data from two different time windows with TWCS 
(CASSANDRA-17970)
   * Do not spam the logs with MigrationCoordinator not being able to pull 
schemas (CASSANDRA-18096)
   * Fix incorrect resource name in LIST PERMISSION output (CASSANDRA-17848)
   * Suppress CVE-2022-41854 and similar (CASSANDRA-18083)
diff --cc 
test/unit/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyTest.java
index 38033f156e,15d2a2e705..88c63082cb
--- 
a/test/unit/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyTest.java
+++ 
b/test/unit/org/apache/cassandra/db/compaction/TimeWindowCompactionStrategyTest.java
@@@ -46,6 -47,7 +48,7 @@@ import org.apache.cassandra.db.RowUpdat
  import org.apache.cassandra.exceptions.ConfigurationException;
  import org.apache.cassandra.io.sstable.format.SSTableReader;
  import org.apache.cassandra.schema.KeyspaceParams;
 -import org.apache.cassandra.MockSchema;
++import org.apache.cassandra.schema.MockSchema;
  import org.apache.cassandra.utils.Pair;
  
  import static 
org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy.getWindowBoundsInMillis;
diff --cc test/unit/org/apache/cassandra/schema/MockSchema.java
index 901acbfcf2,00..194f3db32f
mode 100644,00..100644
--- a/test/unit/org/apache/cassandra/schema/MockSchema.java
+++ b/test/unit/org/apache/cassandra/schema/MockSchema.java
@@@ -1,239 -1,0 +1,250 @@@
 +/*
 +* 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 java.io.File;
 +import java.io.IOException;
 +import java.io.RandomAccessFile;
 +import java.util.*;
 +import java.util.concurrent.atomic.AtomicInteger;
 +import java.util.function.Function;
 +
 +import com.google.common.collect.ImmutableSet;
 +
 +import org.apache.cassandra.config.DatabaseDescriptor;
 +import org.apache.cassandra.db.*;
 +import org.apache.cassandra.db.marshal.UTF8Type;
 +import org.apache.cassandra.dht.Murmur3Partitioner;
 +import org.apache.cassandra.io.sstable.Component;
 +import org.apache.cassandra.io.sstable.Descriptor;
 +import org.apache.cassandra.io.sstable.IndexSummary;
 +import org.apache.cassandra.io.sstable.format.SSTableFormat;
 +import org.apache.cassandra.io.sstable.format.SSTableReader;
 +import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
 +import org.apache.cassandra.io.sstable.metadata.MetadataType;
 +import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
 +import org.apache.cassandra.io.util.ChannelProxy;
 +import org.apache.cassandra.io.util.FileHandle;
 +import org.apache.cassandra.io.util.FileUtils;
 +import org.apache.cassandra.io.util.Memory;
 +import org.apache.cassandra.utils.AlwaysPresentFilter;
 +import org.apache.cassandra.utils.ByteBufferUtil;
 +
 +import static 
org.apache.cassandra.service.ActiveRepairService.UNREPAIRED_SSTABLE;
 +
 +pub

[cassandra] branch trunk updated: Only reload compaction strategies if disk boundaries change

2022-12-15 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 94bcb4e5ec Only reload compaction strategies if disk boundaries change
94bcb4e5ec is described below

commit 94bcb4e5ec4fb99b73276d90b9d08def6f3b4d30
Author: Marcus Eriksson 
AuthorDate: Thu Sep 1 09:43:47 2022 +0200

Only reload compaction strategies if disk boundaries change

Patch by Aleksey Yeschenko and marcuse; reviewed by Aleksey Yeschenko for 
CASSANDRA-17874

Co-authored-by: Aleksey Yeschenko 
---
 CHANGES.txt|   1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   4 +-
 .../org/apache/cassandra/db/DiskBoundaries.java|   8 ++
 .../db/compaction/CompactionStrategyManager.java   | 153 +
 ...ompactionStrategyManagerBoundaryReloadTest.java | 103 ++
 5 files changed, 213 insertions(+), 56 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 04ff21265a..160ecef46b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.2
+ * Only reload compaction strategies if disk boundaries change 
(CASSANDRA-17874)
  * CEP-10: Simulator Java11 Support (CASSANDRA-17178)
  * Set the major compaction type correctly for compactionstats 
(CASSANDRA-18055)
  * Print exception message without stacktrace when nodetool commands fail on 
probe.getOwnershipWithPort() (CASSANDRA-18079)
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index cb164a030f..b00a77ab40 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -385,7 +385,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean, Memtable.Owner
 for (ColumnFamilyStore cfs : concatWithIndexes())
 cfs.crcCheckChance = new 
DefaultValue(metadata().params.crcCheckChance);
 
-compactionStrategyManager.maybeReload(metadata());
+
compactionStrategyManager.maybeReloadParamsFromSchema(metadata().params.compaction);
 
 indexManager.reload();
 
@@ -418,7 +418,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean, Memtable.Owner
 {
 CompactionParams compactionParams = 
CompactionParams.fromMap(options);
 compactionParams.validate();
-
compactionStrategyManager.setNewLocalCompactionStrategy(compactionParams);
+compactionStrategyManager.overrideLocalParams(compactionParams);
 }
 catch (Throwable t)
 {
diff --git a/src/java/org/apache/cassandra/db/DiskBoundaries.java 
b/src/java/org/apache/cassandra/db/DiskBoundaries.java
index c340d2703d..32edcac433 100644
--- a/src/java/org/apache/cassandra/db/DiskBoundaries.java
+++ b/src/java/org/apache/cassandra/db/DiskBoundaries.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.db;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableList;
@@ -163,4 +164,11 @@ public class DiskBoundaries
 int lastIndex = getDiskIndex(last);
 return directories.subList(firstIndex, lastIndex + 1);
 }
+
+public boolean isEquivalentTo(DiskBoundaries oldBoundaries)
+{
+return oldBoundaries != null &&
+   Objects.equals(positions, oldBoundaries.positions) &&
+   Objects.equals(directories, oldBoundaries.directories);
+}
 }
diff --git 
a/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java 
b/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
index e98e4dd10f..bc0fc0dc81 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
@@ -42,7 +42,6 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.primitives.Longs;
-import org.apache.cassandra.io.util.File;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -67,6 +66,7 @@ import org.apache.cassandra.io.sstable.SSTableMultiWriter;
 import org.apache.cassandra.io.sstable.format.SSTableReader;
 import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
 import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
+import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.notifications.INotification;
 import org.apache.cassandra.notifications.INotificationConsumer;
 import org.apache.cassandra.notifications.SSTableAddedNotification;
@@ -76,7 +76,6 @@ import 
org.apache.cassandra.notifications.SSTableMetadata

[cassandra] branch trunk updated: Add flag to exclude nodes from local DC when running nodetool rebuild

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

marcuse 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 145dbd1f08 Add flag to exclude nodes from local DC when running 
nodetool rebuild
145dbd1f08 is described below

commit 145dbd1f0875ae4c54392125e09ed05153c0dd8f
Author: Saranya Krishnakumar 
AuthorDate: Wed Oct 19 16:58:41 2022 -0700

Add flag to exclude nodes from local DC when running nodetool rebuild

Patch by Saranya Krishnakumar; reviewed by Dinesh Joshi, Marcus Eriksson, 
Yifan Cai for CASSANDRA-17870
---
 CHANGES.txt|  1 +
 .../org/apache/cassandra/dht/RangeStreamer.java| 27 ++
 .../apache/cassandra/service/StorageService.java   | 16 -
 .../cassandra/service/StorageServiceMBean.java | 14 +++
 src/java/org/apache/cassandra/tools/NodeProbe.java |  4 ++--
 .../apache/cassandra/tools/nodetool/Rebuild.java   |  9 ++--
 .../cassandra/service/StorageServiceTest.java  | 15 
 7 files changed, 81 insertions(+), 5 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index eed3363cd4..fd4903ef48 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.2
+ * Add flag to exclude nodes from local DC when running nodetool rebuild 
(CASSANDRA-17870)
  * Adding endpoint verification option to client_encryption_options 
(CASSANDRA-18034)
  * Replace 'wcwidth.py' with pypi module (CASSANDRA-17287)
  * Add nodetool forcecompact to remove tombstoned or ttl'd data ignoring GC 
grace for given table and partition keys (CASSANDRA-17711)
diff --git a/src/java/org/apache/cassandra/dht/RangeStreamer.java 
b/src/java/org/apache/cassandra/dht/RangeStreamer.java
index 08d834459a..9b7833b90a 100644
--- a/src/java/org/apache/cassandra/dht/RangeStreamer.java
+++ b/src/java/org/apache/cassandra/dht/RangeStreamer.java
@@ -203,6 +203,33 @@ public class RangeStreamer
 }
 }
 
+/**
+* Source filter which excludes nodes from local DC.
+*/
+public static class ExcludeLocalDatacenterFilter implements SourceFilter
+{
+private final IEndpointSnitch snitch;
+private final String localDc;
+
+public ExcludeLocalDatacenterFilter(IEndpointSnitch snitch)
+{
+this.snitch = snitch;
+this.localDc = snitch.getLocalDatacenter();
+}
+
+@Override
+public boolean apply(Replica replica)
+{
+return !snitch.getDatacenter(replica).equals(localDc);
+}
+
+@Override
+public String message(Replica replica)
+{
+return "Filtered " + replica + " out because it belongs to the 
local datacenter";
+}
+}
+
 /**
  * Source filter which excludes the current node from source calculations
  */
diff --git a/src/java/org/apache/cassandra/service/StorageService.java 
b/src/java/org/apache/cassandra/service/StorageService.java
index da130c60a0..7dab8745f3 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1280,10 +1280,15 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 
 public void rebuild(String sourceDc)
 {
-rebuild(sourceDc, null, null, null);
+rebuild(sourceDc, null, null, null, false);
 }
 
 public void rebuild(String sourceDc, String keyspace, String tokens, 
String specificSources)
+{
+rebuild(sourceDc, keyspace, tokens, specificSources, false);
+}
+
+public void rebuild(String sourceDc, String keyspace, String tokens, 
String specificSources, boolean excludeLocalDatacenterNodes)
 {
 // check ongoing rebuild
 if (!isRebuilding.compareAndSet(false, true))
@@ -1291,6 +1296,12 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 throw new IllegalStateException("Node is still rebuilding. Check 
nodetool netstats.");
 }
 
+// fail if source DC is local and --exclude-local-dc is set
+if (sourceDc != null && 
sourceDc.equals(DatabaseDescriptor.getLocalDataCenter()) && 
excludeLocalDatacenterNodes)
+{
+throw new IllegalArgumentException("Cannot set source data center 
to be local data center, when excludeLocalDataCenter flag is set");
+}
+
 try
 {
 // check the arguments
@@ -1317,6 +1328,9 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
 if (sourceDc != null)
 streamer.addSourceFilter(new 
RangeStreamer.SingleDatacenterFilter(DatabaseDescriptor.getEndpointSnitch(), 
sourceDc));
 
+if (excludeLocalDatacenterNodes)
+streamer.addSour

[cassandra] branch trunk updated: Keep sstable level when streaming for decommission and move

2022-10-19 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 7e6799a4b9 Keep sstable level when streaming for decommission and move
7e6799a4b9 is described below

commit 7e6799a4b903b4cdc1a467ada69f2f12a6099fcb
Author: Marcus Eriksson 
AuthorDate: Tue Oct 18 08:26:21 2022 +0200

Keep sstable level when streaming for decommission and move

Patch by marcuse; reviewed by David Capwell for CASSANDRA-17969
---
 CHANGES.txt|   1 +
 .../db/streaming/CassandraOutgoingFile.java|   4 +-
 .../cassandra/streaming/StreamOperation.java   |  43 ---
 .../test/streaming/LCSStreamingKeepLevelTest.java  | 128 +
 4 files changed, 154 insertions(+), 22 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 96e30bab5c..b2a7ae0d05 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.2
+ * Keep sstable level when streaming for decommission and move 
(CASSANDRA-17969)
  * Add Unavailables metric for CASWrite in the docs (CASSANDRA-16357)
  * Make Cassandra logs able to be viewed in the virtual table 
system_views.system_logs (CASSANDRA-17946)
  * IllegalArgumentException in Gossiper#order due to concurrent mutations to 
elements being applied (CASSANDRA-17908)
diff --git 
a/src/java/org/apache/cassandra/db/streaming/CassandraOutgoingFile.java 
b/src/java/org/apache/cassandra/db/streaming/CassandraOutgoingFile.java
index 367c304b08..6a712276bb 100644
--- a/src/java/org/apache/cassandra/db/streaming/CassandraOutgoingFile.java
+++ b/src/java/org/apache/cassandra/db/streaming/CassandraOutgoingFile.java
@@ -76,8 +76,6 @@ public class CassandraOutgoingFile implements OutgoingStream
 boolean 
shouldStreamEntireSSTable,
 ComponentManifest manifest)
 {
-boolean keepSSTableLevel = operation == StreamOperation.BOOTSTRAP || 
operation == StreamOperation.REBUILD;
-
 CompressionInfo compressionInfo = sstable.compression
 ? 
CompressionInfo.newLazyInstance(sstable.getCompressionMetadata(), sections)
 : null;
@@ -85,7 +83,7 @@ public class CassandraOutgoingFile implements OutgoingStream
 return CassandraStreamHeader.builder()
 
.withSSTableFormat(sstable.descriptor.formatType)
 
.withSSTableVersion(sstable.descriptor.version)
-.withSSTableLevel(keepSSTableLevel ? 
sstable.getSSTableLevel() : 0)
+
.withSSTableLevel(operation.keepSSTableLevel() ? sstable.getSSTableLevel() : 0)
 .withEstimatedKeys(estimatedKeys)
 .withSections(sections)
 .withCompressionInfo(compressionInfo)
diff --git a/src/java/org/apache/cassandra/streaming/StreamOperation.java 
b/src/java/org/apache/cassandra/streaming/StreamOperation.java
index 8151b47b22..98a4070d2b 100644
--- a/src/java/org/apache/cassandra/streaming/StreamOperation.java
+++ b/src/java/org/apache/cassandra/streaming/StreamOperation.java
@@ -19,43 +19,43 @@ package org.apache.cassandra.streaming;
 
 public enum StreamOperation
 {
-OTHER("Other"), // Fallback to avoid null types when deserializing from 
string
-RESTORE_REPLICA_COUNT("Restore replica count", false), // Handles 
removeNode
-DECOMMISSION("Unbootstrap", false),
-RELOCATION("Relocation", false),
-BOOTSTRAP("Bootstrap", false),
-REBUILD("Rebuild", false),
-BULK_LOAD("Bulk Load"),
-REPAIR("Repair");
+OTHER("Other", true, false), // Fallback to avoid null types when 
deserializing from string
+RESTORE_REPLICA_COUNT("Restore replica count", false, false), // Handles 
removeNode
+DECOMMISSION("Unbootstrap", false, true),
+RELOCATION("Relocation", false, true),
+BOOTSTRAP("Bootstrap", false, true),
+REBUILD("Rebuild", false, true),
+BULK_LOAD("Bulk Load", true, false),
+REPAIR("Repair", true, false);
 
 private final String description;
 private final boolean requiresViewBuild;
-
-
-StreamOperation(String description) {
-this(description, true);
-}
+private final boolean keepSSTableLevel;
 
 /**
  * @param description The operation description
  * @param requiresViewBuild Whether this operation requires views to be 
updated if it involves a base table
  */
-StreamOperation(String description, boolean requiresViewBuild) {
+StreamOperation(String description, boolean requiresViewBuild

[cassandra] branch cassandra-4.0 updated: Improve the way we handle repair message timeouts to avoid hanging repairs

2022-08-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 5beab63b55 Improve the way we handle repair message timeouts to avoid 
hanging repairs
5beab63b55 is described below

commit 5beab63b5550efb5e31e5005f90649661a9fe595
Author: Marcus Eriksson 
AuthorDate: Mon Aug 29 13:27:16 2022 +0200

Improve the way we handle repair message timeouts to avoid hanging repairs

Patch by marcuse; reviewed by David Capwell for CASSANDRA-17613
---
 CHANGES.txt|   1 +
 src/java/org/apache/cassandra/config/Config.java   |   2 +
 .../cassandra/config/DatabaseDescriptor.java   |  10 +++
 src/java/org/apache/cassandra/net/Verb.java|  33 +++
 .../cassandra/repair/AsymmetricRemoteSyncTask.java |   7 +-
 .../cassandra/repair/RepairMessageVerbHandler.java |   4 +
 .../cassandra/repair/StreamingRepairTask.java  |   9 +-
 .../cassandra/repair/SymmetricRemoteSyncTask.java  |  11 ---
 src/java/org/apache/cassandra/repair/SyncTask.java |  12 +++
 .../apache/cassandra/repair/ValidationTask.java|   9 +-
 .../cassandra/repair/messages/RepairMessage.java   |  63 +
 .../apache/cassandra/service/StorageService.java   |  13 +++
 .../cassandra/service/StorageServiceMBean.java |   3 +
 .../distributed/test/RepairRequestTimeoutTest.java | 100 +
 14 files changed, 240 insertions(+), 37 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index e1f8d19c30..96a37f53e9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.7
+ * Avoid getting hanging repairs due to repair message timeouts 
(CASSANDRA-17613)
  * Prevent infinite loop in repair coordinator on FailSession (CASSANDRA-17834)
 Merged from 3.11:
  * Fix potential IndexOutOfBoundsException in PagingState in mixed mode 
clusters (CASSANDRA-17840)
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index e8aa297e77..f8d8d46db8 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -134,6 +134,8 @@ public class Config
 public volatile Integer repair_session_max_tree_depth = null;
 public volatile Integer repair_session_space_in_mb = null;
 
+public volatile long repair_request_timeout_in_ms = 
TimeUnit.MILLISECONDS.convert(1, TimeUnit.MINUTES);
+
 public volatile boolean use_offheap_merkle_trees = true;
 
 public int storage_port = 7000;
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 82a5ec73ba..f78a5b668a 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1723,6 +1723,16 @@ public class DatabaseDescriptor
 return unit.convert(getBlockForPeersTimeoutInSeconds(), 
TimeUnit.SECONDS);
 }
 
+public static long getRepairRpcTimeout(TimeUnit unit)
+{
+return unit.convert(conf.repair_request_timeout_in_ms, MILLISECONDS);
+}
+
+public static void setRepairRpcTimeout(long time, TimeUnit unit)
+{
+conf.repair_request_timeout_in_ms = MILLISECONDS.convert(time, unit);
+}
+
 public static double getPhiConvictThreshold()
 {
 return conf.phi_convict_threshold;
diff --git a/src/java/org/apache/cassandra/net/Verb.java 
b/src/java/org/apache/cassandra/net/Verb.java
index fad2fbf6a9..9d8b76dd35 100644
--- a/src/java/org/apache/cassandra/net/Verb.java
+++ b/src/java/org/apache/cassandra/net/Verb.java
@@ -147,22 +147,22 @@ public enum Verb
 SCHEMA_VERSION_REQ (20,  P1, rpcTimeout,  MIGRATION, () -> 
NoPayload.serializer, () -> SchemaVersionVerbHandler.instance,  
 SCHEMA_VERSION_RSP  ),
 
 // repair; mostly doesn't use callbacks and sends responses as their own 
request messages, with matching sessions by uuid; should eventually harmonize 
and make idiomatic
-REPAIR_RSP (100, P1, rpcTimeout,  REQUEST_RESPONSE,  () -> 
NoPayload.serializer, () -> ResponseVerbHandler.instance
 ),
-VALIDATION_RSP (102, P1, rpcTimeout,  ANTI_ENTROPY,  () -> 
ValidationResponse.serializer,() -> RepairMessageVerbHandler.instance,  
 REPAIR_RSP  ),
-VALIDATION_REQ (101, P1, rpcTimeout,  ANTI_ENTROPY,  () -> 
ValidationRequest.serializer, () -> RepairMessageVerbHandler.instance,  
 REPAIR_RSP  ),
-SYNC_RSP   (104, P1, rpcTimeout,  ANTI_ENTROPY,  () -> 
SyncResponse.serializer,  () -> RepairMessageVerbHandler.instance,  
 REPAIR_RSP  ),
-SYNC_REQ 

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

2022-08-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 1b9c6d83ec30d701c46addf5ffbada843139b718
Merge: 756d506bd9 cd576a0d14
Author: Marcus Eriksson 
AuthorDate: Mon Aug 29 13:29:14 2022 +0200

Merge branch 'cassandra-4.1' into trunk

 CHANGES.txt|   4 +
 src/java/org/apache/cassandra/config/Config.java   |   1 +
 src/java/org/apache/cassandra/net/Verb.java|   2 +-
 .../cassandra/repair/AsymmetricRemoteSyncTask.java |   7 +-
 .../cassandra/repair/RepairMessageVerbHandler.java |   5 +-
 .../cassandra/repair/StreamingRepairTask.java  |   9 +-
 .../cassandra/repair/SymmetricRemoteSyncTask.java  |  10 ---
 src/java/org/apache/cassandra/repair/SyncTask.java |  11 +++
 .../apache/cassandra/repair/ValidationTask.java|   9 +-
 .../cassandra/repair/messages/RepairMessage.java   |  63 +
 .../cassandra/service/ActiveRepairService.java |   2 -
 .../distributed/test/RepairCoordinatorBase.java|   3 +
 .../distributed/test/RepairRequestTimeoutTest.java | 100 +
 .../upgrade/RepairRequestTimeoutUpgradeTest.java   |  58 
 14 files changed, 260 insertions(+), 24 deletions(-)



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



[cassandra] branch trunk updated (756d506bd9 -> 1b9c6d83ec)

2022-08-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 756d506bd9 Merge branch 'cassandra-4.1' into trunk
 new 5beab63b55 Improve the way we handle repair message timeouts to avoid 
hanging repairs
 new cd576a0d14 Merge branch 'cassandra-4.0' into cassandra-4.1
 new 1b9c6d83ec Merge branch 'cassandra-4.1' 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:
 CHANGES.txt|   4 +
 src/java/org/apache/cassandra/config/Config.java   |   1 +
 src/java/org/apache/cassandra/net/Verb.java|   2 +-
 .../cassandra/repair/AsymmetricRemoteSyncTask.java |   7 +-
 .../cassandra/repair/RepairMessageVerbHandler.java |   5 +-
 .../cassandra/repair/StreamingRepairTask.java  |   9 +-
 .../cassandra/repair/SymmetricRemoteSyncTask.java  |  10 ---
 src/java/org/apache/cassandra/repair/SyncTask.java |  11 +++
 .../apache/cassandra/repair/ValidationTask.java|   9 +-
 .../cassandra/repair/messages/RepairMessage.java   |  63 +
 .../cassandra/service/ActiveRepairService.java |   2 -
 .../distributed/test/RepairCoordinatorBase.java|   3 +
 .../distributed/test/RepairRequestTimeoutTest.java | 100 +
 ...t.java => RepairRequestTimeoutUpgradeTest.java} |  30 ---
 14 files changed, 220 insertions(+), 36 deletions(-)
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/test/RepairRequestTimeoutTest.java
 copy 
test/distributed/org/apache/cassandra/distributed/upgrade/{UpgradeTest.java => 
RepairRequestTimeoutUpgradeTest.java} (57%)


-
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 cassandra-4.1

2022-08-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit cd576a0d140c94007fd0181044df453c0681252f
Merge: 726b67b1e4 5beab63b55
Author: Marcus Eriksson 
AuthorDate: Mon Aug 29 13:27:46 2022 +0200

Merge branch 'cassandra-4.0' into cassandra-4.1

 CHANGES.txt|   4 +
 src/java/org/apache/cassandra/config/Config.java   |   1 +
 src/java/org/apache/cassandra/net/Verb.java|   2 +-
 .../cassandra/repair/AsymmetricRemoteSyncTask.java |   7 +-
 .../cassandra/repair/RepairMessageVerbHandler.java |   5 +-
 .../cassandra/repair/StreamingRepairTask.java  |   9 +-
 .../cassandra/repair/SymmetricRemoteSyncTask.java  |  10 ---
 src/java/org/apache/cassandra/repair/SyncTask.java |  11 +++
 .../apache/cassandra/repair/ValidationTask.java|   9 +-
 .../cassandra/repair/messages/RepairMessage.java   |  63 +
 .../cassandra/service/ActiveRepairService.java |   2 -
 .../distributed/test/RepairCoordinatorBase.java|   3 +
 .../distributed/test/RepairRequestTimeoutTest.java | 100 +
 .../upgrade/RepairRequestTimeoutUpgradeTest.java   |  58 
 14 files changed, 260 insertions(+), 24 deletions(-)

diff --cc CHANGES.txt
index 4335f0ea2f,96a37f53e9..bf0ea108f8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,47 -1,12 +1,51 @@@
 +4.1-alpha2
 + * Fix BulkLoader to load entireSSTableThrottle and 
entireSSTableInterDcThrottle (CASSANDRA-17677)
 + * Fix a race condition where a keyspace can be oopened while it is being 
removed (CASSANDRA-17658)
 + * DatabaseDescriptor will set the default failure detector during client 
initialization (CASSANDRA-17782)
 + * Avoid initializing schema via SystemKeyspace.getPreferredIP() with the 
BulkLoader tool (CASSANDRA-17740)
 + * Uncomment prepared_statements_cache_size, key_cache_size, 
counter_cache_size, index_summary_capacity which were
 +   commented out by mistake in a previous patch
 +   Fix breaking change with cache_load_timeout; cache_load_timeout_seconds 
<=0 and cache_load_timeout=0 are equivalent
 +   and they both mean disabled
 +   Deprecate public method setRate(final double throughputMbPerSec) in 
Compaction Manager in favor of
 +   setRateInBytes(final double throughputBytesPerSec)
 +   Revert breaking change removal of 
StressCQLSSTableWriter.Builder.withBufferSizeInMB(int size). Deprecate it in 
favor
 +   of StressCQLSSTableWriter.Builder.withBufferSizeInMiB(int size)
 +   Fix precision issues, add new -m flag (for nodetool/setstreamthroughput, 
nodetool/setinterdcstreamthroughput,
 +   nodetool/getstreamthroughput and nodetoo/getinterdcstreamthroughput), add 
new -d flags (nodetool/getstreamthroughput, 
nodetool/getinterdcstreamthroughput, nodetool/getcompactionthroughput)
 +   Fix a bug with precision in nodetool/compactionstats
 +   Deprecate StorageService methods and add new ones for 
stream_throughput_outbound, inter_dc_stream_throughput_outbound,
 +   compaction_throughput_outbound in the JMX MBean 
`org.apache.cassandra.db:type=StorageService`
 +   Removed getEntireSSTableStreamThroughputMebibytesPerSec in favor of new 
getEntireSSTableStreamThroughputMebibytesPerSecAsDouble
 +   in the JMX MBean `org.apache.cassandra.db:type=StorageService`
 +   Removed getEntireSSTableInterDCStreamThroughputMebibytesPerSec in favor of 
getEntireSSTableInterDCStreamThroughputMebibytesPerSecAsDouble
 +   in the JMX MBean `org.apache.cassandra.db:type=StorageService` 
(CASSANDRA-17725)
 + * Fix sstable_preemptive_open_interval disabled value. 
sstable_preemptive_open_interval = null backward compatible with
 +   sstable_preemptive_open_interval_in_mb = -1 (CASSANDRA-17737)
 + * Remove usages of Path#toFile() in the snapshot apparatus (CASSANDRA-17769)
 + * Fix Settings Virtual Table to update paxos_variant after startup and 
rename enable_uuid_sstable_identifiers to
 +   uuid_sstable_identifiers_enabled as per our config naming conventions 
(CASSANDRA-17738)
 + * index_summary_resize_interval_in_minutes = -1 is equivalent to 
index_summary_resize_interval being set to null or
 +   disabled. JMX MBean IndexSummaryManager, setResizeIntervalInMinutes method 
still takes resizeIntervalInMinutes = -1 for disabled (CASSANDRA-17735)
 + * min_tracked_partition_size_bytes parameter from 4.1 alpha1 was renamed to 
min_tracked_partition_size (CASSANDRA-17733)
 + * Remove commons-lang dependency during build runtime (CASSANDRA-17724)
 + * Relax synchronization on StreamSession#onError() to avoid deadlock 
(CASSANDRA-17706)
 + * Fix AbstractCell#toString throws MarshalException for cell in collection 
(CASSANDRA-17695)
 + * Add new vtable output option to compactionstats (CASSANDRA-17683)
 + * Fix commitLogUpperBound initialization in AbstractMemtableWithCommitlog 
(CASSANDRA-17587)
 + * Fix widening to long in getBatchSizeFailThreshold (CASSANDRA-17650)
 + * Fix widen

[cassandra] branch cassandra-4.1 updated (726b67b1e4 -> cd576a0d14)

2022-08-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 726b67b1e4 Merge branch 'cassandra-4.0' into cassandra-4.1
 new 5beab63b55 Improve the way we handle repair message timeouts to avoid 
hanging repairs
 new cd576a0d14 Merge branch 'cassandra-4.0' into cassandra-4.1

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:
 CHANGES.txt|   4 +
 src/java/org/apache/cassandra/config/Config.java   |   1 +
 src/java/org/apache/cassandra/net/Verb.java|   2 +-
 .../cassandra/repair/AsymmetricRemoteSyncTask.java |   7 +-
 .../cassandra/repair/RepairMessageVerbHandler.java |   5 +-
 .../cassandra/repair/StreamingRepairTask.java  |   9 +-
 .../cassandra/repair/SymmetricRemoteSyncTask.java  |  10 ---
 src/java/org/apache/cassandra/repair/SyncTask.java |  11 +++
 .../apache/cassandra/repair/ValidationTask.java|   9 +-
 .../cassandra/repair/messages/RepairMessage.java   |  63 +
 .../cassandra/service/ActiveRepairService.java |   2 -
 .../distributed/test/RepairCoordinatorBase.java|   3 +
 .../distributed/test/RepairRequestTimeoutTest.java | 100 +
 ...t.java => RepairRequestTimeoutUpgradeTest.java} |  32 ---
 14 files changed, 221 insertions(+), 37 deletions(-)
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/test/RepairRequestTimeoutTest.java
 copy 
test/distributed/org/apache/cassandra/distributed/upgrade/{UpgradeTest.java => 
RepairRequestTimeoutUpgradeTest.java} (57%)


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



[cassandra-dtest] branch trunk updated: Ignore error from non-related keyspaces to fix repair_tests/repair_test.py::TestRepair::test_non_replicated_ks_repair

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

marcuse 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 e76008d0 Ignore error from non-related keyspaces to fix 
repair_tests/repair_test.py::TestRepair::test_non_replicated_ks_repair
e76008d0 is described below

commit e76008d0a71bce385210e7cdf820c9b6459b8c80
Author: Marcus Eriksson 
AuthorDate: Mon May 9 17:48:40 2022 +0200

Ignore error from non-related keyspaces to fix 
repair_tests/repair_test.py::TestRepair::test_non_replicated_ks_repair

Patch by marcuse; reviewed by Berenguer Blasi for CASSANDRA-17614
---
 repair_tests/repair_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repair_tests/repair_test.py b/repair_tests/repair_test.py
index af536a76..29f46e90 100644
--- a/repair_tests/repair_test.py
+++ b/repair_tests/repair_test.py
@@ -977,7 +977,7 @@ class TestRepair(BaseRepairTest):
 assert len(node.grep_log("in repair1 - unreplicated keyspace is 
ignored since repair was called with --ignore-unreplicated-keyspaces")) > 0
 
 try:
-self.fixture_dtest_setup.ignore_log_patterns.append("Nothing to 
repair for .+ in repair1")
+self.fixture_dtest_setup.ignore_log_patterns.append("Nothing to 
repair for .+ in .+")
 node.nodetool("repair -st 0 -et 1")
 assert False, "repair should fail"
 except ToolError:


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



[cassandra] branch trunk updated (c6207171f2 -> 6c20fbca4a)

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

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


from c6207171f2 Merge branch 'cassandra-4.1' into trunk
 new 3b648ca09e Use TimeUUID serializer for BATCH_REMOVE_REQ
 new 6c20fbca4a Merge branch 'cassandra-4.1' 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:
 src/java/org/apache/cassandra/net/Verb.java|  3 +-
 .../distributed/upgrade/BatchUpgradeTest.java  | 56 ++
 2 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 
test/distributed/org/apache/cassandra/distributed/upgrade/BatchUpgradeTest.java


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



[cassandra] branch cassandra-4.1 updated: Use TimeUUID serializer for BATCH_REMOVE_REQ

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

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


The following commit(s) were added to refs/heads/cassandra-4.1 by this push:
 new 3b648ca09e Use TimeUUID serializer for BATCH_REMOVE_REQ
3b648ca09e is described below

commit 3b648ca09ecfc100d5ad2e3b462d4949dbc03498
Author: Marcus Eriksson 
AuthorDate: Thu Apr 28 15:50:11 2022 +0200

Use TimeUUID serializer for BATCH_REMOVE_REQ

Patch by marcuse; reviewed by Benedict Elliott Smith for CASSANDRA-17451
---
 src/java/org/apache/cassandra/net/Verb.java|  3 +-
 .../distributed/upgrade/BatchUpgradeTest.java  | 56 ++
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/net/Verb.java 
b/src/java/org/apache/cassandra/net/Verb.java
index 0818d4194d..597da3fb9a 100644
--- a/src/java/org/apache/cassandra/net/Verb.java
+++ b/src/java/org/apache/cassandra/net/Verb.java
@@ -96,6 +96,7 @@ import org.apache.cassandra.service.paxos.PrepareResponse;
 import org.apache.cassandra.service.paxos.v1.PrepareVerbHandler;
 import org.apache.cassandra.service.paxos.v1.ProposeVerbHandler;
 import org.apache.cassandra.streaming.ReplicationDoneVerbHandler;
+import org.apache.cassandra.utils.TimeUUID;
 import org.apache.cassandra.utils.UUIDSerializer;
 
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
@@ -118,7 +119,7 @@ public enum Verb
 BATCH_STORE_RSP(65,  P1, writeTimeout,REQUEST_RESPONSE,  () -> 
NoPayload.serializer, () -> ResponseVerbHandler.instance
 ),
 BATCH_STORE_REQ(5,   P3, writeTimeout,MUTATION,  () -> 
Batch.serializer, () -> BatchStoreVerbHandler.instance, 
 BATCH_STORE_RSP ),
 BATCH_REMOVE_RSP   (66,  P1, writeTimeout,REQUEST_RESPONSE,  () -> 
NoPayload.serializer, () -> ResponseVerbHandler.instance
 ),
-BATCH_REMOVE_REQ   (6,   P3, writeTimeout,MUTATION,  () -> 
UUIDSerializer.serializer,() -> BatchRemoveVerbHandler.instance,
 BATCH_REMOVE_RSP),
+BATCH_REMOVE_REQ   (6,   P3, writeTimeout,MUTATION,  () -> 
TimeUUID.Serializer.instance, () -> BatchRemoveVerbHandler.instance,
 BATCH_REMOVE_RSP),
 
 PAXOS_PREPARE_RSP  (93,  P2, writeTimeout,REQUEST_RESPONSE,  () -> 
PrepareResponse.serializer,   () -> ResponseVerbHandler.instance
 ),
 PAXOS_PREPARE_REQ  (33,  P2, writeTimeout,MUTATION,  () -> 
Commit.serializer,() -> PrepareVerbHandler.instance,
 PAXOS_PREPARE_RSP   ),
diff --git 
a/test/distributed/org/apache/cassandra/distributed/upgrade/BatchUpgradeTest.java
 
b/test/distributed/org/apache/cassandra/distributed/upgrade/BatchUpgradeTest.java
new file mode 100644
index 00..fb442331bf
--- /dev/null
+++ 
b/test/distributed/org/apache/cassandra/distributed/upgrade/BatchUpgradeTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.distributed.upgrade;
+
+import org.junit.Test;
+
+import org.apache.cassandra.distributed.api.ConsistencyLevel;
+
+import static org.junit.Assert.assertEquals;
+
+public class BatchUpgradeTest extends UpgradeTestBase
+{
+@Test
+public void batchTest() throws Throwable
+{
+new TestCase()
+.nodes(2)
+
+.nodesToUpgrade(2)
+.upgradesFrom(v40).setup((cluster) -> {
+cluster.schemaChange("CREATE TABLE "+KEYSPACE+".users (" +
+ "userid uuid PRIMARY KEY," +
+ "firstname ascii," +
+ "lastname ascii," +
+ "age int) WITH COMPACT STORAGE");
+}).runAfterNodeUpgrade((cluster, node) -> {
+cluster.coordinator(2).execute("BEGIN BATCH\n" +
+   

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

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

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

commit 6c20fbca4a42dc0dde8910ce2b1096861957040c
Merge: c6207171f2 3b648ca09e
Author: Marcus Eriksson 
AuthorDate: Wed May 4 08:18:49 2022 +0200

Merge branch 'cassandra-4.1' into trunk

 src/java/org/apache/cassandra/net/Verb.java|  3 +-
 .../distributed/upgrade/BatchUpgradeTest.java  | 56 ++
 2 files changed, 58 insertions(+), 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: Fail starting when the same parameter exists more than once in cassandra.yaml

2022-04-29 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 7ce140bd1d Fail starting when the same parameter exists more than once 
in cassandra.yaml
7ce140bd1d is described below

commit 7ce140bd1dea311b9f98cdfbcd07dcff9fbd457c
Author: Marcus Eriksson 
AuthorDate: Thu Apr 7 14:43:40 2022 +0200

Fail starting when the same parameter exists more than once in 
cassandra.yaml

Patch by marcuse; reviewed by David Capwell and Ekaterina Dimitrova for 
CASSANDRA-17379
---
 CHANGES.txt|   1 +
 NEWS.txt   |   3 +
 .../config/CassandraRelevantProperties.java|   5 +
 src/java/org/apache/cassandra/config/Config.java   |   5 +-
 .../org/apache/cassandra/config/Replacement.java   |   5 +
 .../cassandra/config/YamlConfigurationLoader.java  |  49 +-
 .../config/FailStartupDuplicateParamsTest.java | 167 +
 7 files changed, 228 insertions(+), 7 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 09e1471b33..ff466d831d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.1
+ * Allow failing startup on duplicate config keys (CASSANDRA-17379)
  * Migrate threshold for minimum keyspace replication factor to guardrails 
(CASSANDRA-17212)
  * Add guardrail to disallow TRUNCATE and DROP TABLE commands (CASSANDRA-17558)
  * Add plugin support for CQLSH (CASSANDRA-16456)
diff --git a/NEWS.txt b/NEWS.txt
index cd13c996d4..d5a05a77a4 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -175,6 +175,9 @@ Upgrading
   parameters. List of changed parameters and details to consider during 
configuration setup can be
   found at 
https://cassandra.apache.org/doc/latest/cassandra/new/configuration.html. 
(CASSANDRA-15234)
   Backward compatibility with the old cassandra.yaml file will be in place 
until at least the next major version.
+  By default we refuse starting Cassandra with a config containing both 
old and new config keys for the same parameter. Start
+  Cassandra with -Dcassandra.allow_new_old_config_keys=true to override. 
For historical reasons duplicate config keys
+  in cassandra.yaml are allowed by default, start Cassandra with 
-Dcassandra.allow_duplicate_config_keys=false to disallow this.
 - Many cassandra.yaml parameters' names have been changed. Full list and 
details to consider during configuration setup
   when installing/upgrading Cassandra can be found at 
https://cassandra.apache.org/doc/latest/cassandra/new/configuration.html 
(CASSANDRA-15234)
 - Negative values cannot be used for parameters of type data rate, 
duration and data storage with both old and new cassandra.yaml version.
diff --git 
a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java 
b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
index 646a1193da..19b7d2a70d 100644
--- a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
+++ b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
@@ -238,6 +238,11 @@ public enum CassandraRelevantProperties
 
 
PAXOS_REPAIR_RETRY_TIMEOUT_IN_MS("cassandra.paxos_repair_retry_timeout_millis", 
"6"),
 
+/** If we should allow having duplicate keys in the config file, default 
to true for legacy reasons */
+ALLOW_DUPLICATE_CONFIG_KEYS("cassandra.allow_duplicate_config_keys", 
"true"),
+/** If we should allow having both new (post CASSANDRA-15234) and old 
config keys for the same config item in the yaml */
+ALLOW_NEW_OLD_CONFIG_KEYS("cassandra.allow_new_old_config_keys", "false"),
+
 // startup checks properties
 LIBJEMALLOC("cassandra.libjemalloc"),
 @Deprecated // should be removed in favor of enable flag of relevant 
startup check (checkDatacenter)
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index c39d9daaae..1dedb6b817 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -19,10 +19,9 @@ package org.apache.cassandra.config;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.List;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
@@ -1113,7 +1112,7 @@ public class Config
 exception
 }
 
-private static final List SENSITIVE_KEYS = new ArrayList() 
{{
+private static final Set SENSITIVE_KEYS = new HashSet() {{
 add("client_encryption_options");
 add("server_encryption_options");
 }};
diff --git a/src/java/org/apache/cassan

[cassandra] branch trunk updated: Bump timeouts in CasCriticalSectionTest

2022-04-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 bcf56629e8 Bump timeouts in CasCriticalSectionTest
bcf56629e8 is described below

commit bcf56629e821295a22371c2cf178faae0636c68e
Author: Marcus Eriksson 
AuthorDate: Tue Apr 26 10:08:19 2022 +0200

Bump timeouts in CasCriticalSectionTest

Patch by marcuse; reviewed by Brandon Williams for CASSANDRA-17453
---
 .../apache/cassandra/distributed/test/CasCriticalSectionTest.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/test/distributed/org/apache/cassandra/distributed/test/CasCriticalSectionTest.java
 
b/test/distributed/org/apache/cassandra/distributed/test/CasCriticalSectionTest.java
index d354ba0e8c..685e848cb4 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/test/CasCriticalSectionTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/CasCriticalSectionTest.java
@@ -51,9 +51,9 @@ public class CasCriticalSectionTest extends TestBaseImpl
 public void criticalSectionTest() throws IOException, InterruptedException
 {
 try (Cluster cluster = init(Cluster.create(5, c -> 
c.set("paxos_variant", "v2")
-
.set("write_request_timeout_in_ms", 200L)
-
.set("cas_contention_timeout_in_ms", 200L)
-
.set("request_timeout_in_ms", 200L
+
.set("write_request_timeout_in_ms", 2000L)
+
.set("cas_contention_timeout_in_ms", 2000L)
+
.set("request_timeout_in_ms", 2000L
 {
 cluster.schemaChange("create table " + KEYSPACE + ".tbl (pk int, 
ck int, thread_id 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-dtest] branch trunk updated: Bump max_mutation_size_in_kb due to system schema getting larger than 20kb after adding top partitions table

2022-04-28 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 0accec41 Bump max_mutation_size_in_kb due to system schema getting 
larger than 20kb after adding top partitions table
0accec41 is described below

commit 0accec41ae71fc8b381e4a21bdc5d161a7acd650
Author: Marcus Eriksson 
AuthorDate: Wed Apr 27 16:18:57 2022 +0200

Bump max_mutation_size_in_kb due to system schema getting larger than 20kb 
after adding top partitions table

Patch by marcuse; reviewed by Berenguer Blasi for CASSANDRA-16310
---
 materialized_views_test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/materialized_views_test.py b/materialized_views_test.py
index b7e8bd6f..8fcecba6 100644
--- a/materialized_views_test.py
+++ b/materialized_views_test.py
@@ -712,7 +712,7 @@ class TestMaterializedViews(Tester):
 assert_one(session, "SELECT * FROM t_by_v WHERE id = {} 
and v = {}".format(i, j), [j, i])
 
 node4 = new_node(self.cluster, data_center="dc1")
-node4.set_configuration_options(values={'max_mutation_size_in_kb': 
20})  # CASSANDRA-11670
+node4.set_configuration_options(values={'max_mutation_size_in_kb': 
25})  # CASSANDRA-11670
 logger.debug("Start join at {}".format(time.strftime("%H:%M:%S")))
 node4.start(wait_for_binary_proto=True, 
jvm_args=["-Dcassandra.migration_task_wait_in_seconds={}".format(MIGRATION_WAIT)])
 
@@ -765,7 +765,7 @@ class TestMaterializedViews(Tester):
 assert_one(session, "SELECT * FROM t_by_v WHERE id = {} and v 
= {}".format(i, j), [j, i])
 
 node4 = new_node(self.cluster, data_center="dc1")
-node4.set_configuration_options(values={'max_mutation_size_in_kb': 
20})  # CASSANDRA-11670
+node4.set_configuration_options(values={'max_mutation_size_in_kb': 
25})  # CASSANDRA-11670
 logger.debug("Start join at {}".format(time.strftime("%H:%M:%S")))
 node4.start(wait_for_binary_proto=True, 
jvm_args=["-Dcassandra.migration_task_wait_in_seconds={}".format(MIGRATION_WAIT)])
 


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



[cassandra] branch trunk updated: Track top partitions by size and tombstone count

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

marcuse 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 545809616c Track top partitions by size and tombstone count
545809616c is described below

commit 545809616c92a91e4c39d1eedfa65800f25a2a93
Author: Marcus Eriksson 
AuthorDate: Thu Dec 3 11:29:38 2020 +0100

Track top partitions by size and tombstone count

Patch by marcuse; reviewed by David Capwell and Yifan Cai for 
CASSANDRA-16310
---
 NEWS.txt   |   4 +
 src/java/org/apache/cassandra/config/Config.java   |   6 +
 .../cassandra/config/DatabaseDescriptor.java   |  45 +++
 .../org/apache/cassandra/db/ColumnFamilyStore.java |  43 ++-
 .../cassandra/db/ColumnFamilyStoreMBean.java   |   5 +
 .../org/apache/cassandra/db/SystemKeyspace.java|  66 +++-
 .../db/compaction/CompactionIterator.java  |  13 +-
 .../cassandra/db/compaction/CompactionManager.java |   6 +-
 .../db/repair/CassandraTableRepairManager.java |   5 +-
 .../db/repair/CassandraValidationIterator.java |   9 +-
 .../cassandra/metrics/TopPartitionTracker.java | 408 +
 .../cassandra/repair/TableRepairManager.java   |   3 +-
 .../apache/cassandra/repair/ValidationManager.java |  32 +-
 .../org/apache/cassandra/repair/Validator.java |  12 +-
 .../apache/cassandra/service/StorageService.java   |  54 +++
 .../cassandra/service/StorageServiceMBean.java |   9 +
 .../cassandra/tools/nodetool/stats/StatsTable.java |   5 +
 .../tools/nodetool/stats/TableStatsHolder.java |  27 ++
 .../tools/nodetool/stats/TableStatsPrinter.java|  18 +
 .../distributed/test/TopPartitionsTest.java| 317 
 .../cassandra/db/TopPartitionTrackerTest.java  | 334 +
 .../org/apache/cassandra/repair/ValidatorTest.java |   2 +-
 22 files changed, 1403 insertions(+), 20 deletions(-)

diff --git a/NEWS.txt b/NEWS.txt
index fd31e06c93..72c95e00c4 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -99,6 +99,10 @@ New features
   any writes to the CDC-enabled tables will be blocked when reaching to 
the limit for CDC data on disk, which is the
   existing and the default behavior. Setting to false, the writes to the 
CDC-enabled tables will be accepted and
   the oldest CDC data on disk will be deleted to ensure the size 
constraint.
+- Top partitions based on partition size or tombstone count are now 
tracked per table. These partitions are stored
+  in a new system.top_partitions table and exposed via JMX and nodetool 
tablestats. The partitions are tracked
+  during full or validation repairs but not incremental ones since those 
don't include all sstables and the partition
+  size/tombstone count would not be correct.
 - New native functions to convert unix time values into C* native types: 
toDate(bigint), toTimestamp(bigint),
   mintimeuuid(bigint) and maxtimeuuid(bigint)
 - Support for multiple permission in a single GRANT/REVOKE/LIST statement 
has been added. It allows to
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index e0961ed945..2f339418b1 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -1015,6 +1015,12 @@ public class Config
  */
 public volatile int paxos_repair_parallelism = -1;
 
+public volatile int max_top_size_partition_count = 10;
+public volatile int max_top_tombstone_partition_count = 10;
+public volatile DataStorageSpec min_tracked_partition_size_bytes = 
DataStorageSpec.inMebibytes(1);
+public volatile long min_tracked_partition_tombstone_count = 5000;
+public volatile boolean top_partitions_enabled = true;
+
 public static Supplier getOverrideLoadConfig()
 {
 return overrideLoadConfig;
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index c1fee6e5c8..0ce787fe32 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -4194,4 +4194,49 @@ public class DatabaseDescriptor
 conf.repair_state_size = size;
 }
 }
+
+public static boolean topPartitionsEnabled()
+{
+return conf.top_partitions_enabled;
+}
+
+public static int getMaxTopSizePartitionCount()
+{
+return conf.max_top_size_partition_count;
+}
+
+public static void setMaxTopSizePartitionCount(int value)
+{
+conf.max_top_size_partition_count = value;
+}
+
+public static int getMaxTopTombstonePartitionCount()
+{
+return conf.max_top_tombstone_partition_count;
+}
+
+public static void setMaxTopTombstonePartitionCount

[cassandra] branch trunk updated: Remove stress server functionality

2022-04-08 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 537321e9c7 Remove stress server functionality
537321e9c7 is described below

commit 537321e9c7d2696cddc35e808a48846cb67ba52a
Author: Marcus Eriksson 
AuthorDate: Thu Apr 7 09:06:53 2022 +0200

Remove stress server functionality

Patch by marcuse; reviewed by Brandon Williams for CASSANDRA-17535
---
 CHANGES.txt|   1 +
 .../cassandra/pages/tools/cassandra_stress.adoc|   2 -
 redhat/cassandra.spec  |   1 -
 tools/bin/cassandra-stressd|  79 
 .../src/org/apache/cassandra/stress/Stress.java|  88 +-
 .../org/apache/cassandra/stress/StressServer.java  | 135 -
 .../cassandra/stress/settings/CliOption.java   |   1 -
 .../apache/cassandra/stress/settings/Legacy.java   |   5 -
 .../cassandra/stress/settings/SettingsCommand.java |  12 --
 .../cassandra/stress/settings/SettingsMisc.java|  25 
 .../cassandra/stress/settings/StressSettings.java  |   8 +-
 11 files changed, 7 insertions(+), 350 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 39078e562f..b79aa276b5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.1
+ * Remove stress server functionality (CASSANDRA-17535)
  * Reduce histogram snapshot long[] allocation overhead during speculative 
read and write threshold updates (CASSANDRA-17523)
  * Add guardrail for creation of secondary indexes (CASSANDRA-17498)
  * Add guardrail to disallow creation of uncompressed tables (CASSANDRA-17504)
diff --git a/doc/modules/cassandra/pages/tools/cassandra_stress.adoc 
b/doc/modules/cassandra/pages/tools/cassandra_stress.adoc
index bcef193c37..7cf3548c48 100644
--- a/doc/modules/cassandra/pages/tools/cassandra_stress.adoc
+++ b/doc/modules/cassandra/pages/tools/cassandra_stress.adoc
@@ -67,8 +67,6 @@ Primary Options:::
 Custom transport factories
   -port:;;
 The port to connect to cassandra nodes on
-  -sendto:;;
-Specify a stress server to send this command to
   -graph:;;
 Graph recorded metrics
   -tokenrange:;;
diff --git a/redhat/cassandra.spec b/redhat/cassandra.spec
index 15be0b0478..d11e9b0c53 100644
--- a/redhat/cassandra.spec
+++ b/redhat/cassandra.spec
@@ -190,7 +190,6 @@ This package contains extra tools for working with 
Cassandra clusters.
 
 %files tools
 %attr(755,root,root) %{_bindir}/sstabledump
-%attr(755,root,root) %{_bindir}/cassandra-stressd
 %attr(755,root,root) %{_bindir}/compaction-stress
 %attr(755,root,root) %{_bindir}/sstableexpiredblockers
 %attr(755,root,root) %{_bindir}/sstablelevelreset
diff --git a/tools/bin/cassandra-stressd b/tools/bin/cassandra-stressd
deleted file mode 100755
index 83f8006ca5..00
--- a/tools/bin/cassandra-stressd
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# 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.
-
-DESC="Cassandra Stress Test Daemon"
-if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
-# Locations (in order) to use when searching for an include file.
-for include in "`dirname "$0"`/cassandra.in.sh" \
-   "$HOME/.cassandra.in.sh" \
-   /usr/share/cassandra/cassandra.in.sh \
-   /usr/local/share/cassandra/cassandra.in.sh \
-   /opt/cassandra/cassandra.in.sh; do
-if [ -r "$include" ]; then
-. "$include"
-break
-fi
-done
-elif [ -r "$CASSANDRA_INCLUDE" ]; then
-. "$CASSANDRA_INCLUDE"
-fi
-
-if [ -z "$CLASSPATH" ]; then
-echo "You must set the CLASSPATH var" >&2
-exit 1
-fi
-
-case "$1" in
-  start)
-echo "Starting $DESC: "
-"$JAVA" -server -cp "$CLASSPATH" $JVM_OPTS \
--Dcassandra.storagedir="$cassandra_storagedir" \
--Dlogback.configurationFile=logback-tools.xml \
-  

[cassandra] branch trunk updated: Remove and ban use of Instant.now

2022-03-09 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 60675cc  Remove and ban use of Instant.now
60675cc is described below

commit 60675cc2759db0c5629604279e70c51e10dfefd6
Author: Marcus Eriksson 
AuthorDate: Wed Mar 2 11:33:39 2022 +0100

Remove and ban use of Instant.now

Patch by marcuse; reviewed by Benedict Elliott Smith for CASSANDRA-17414
---
 checkstyle.xml|  9 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java| 12 ++--
 src/java/org/apache/cassandra/db/Keyspace.java|  3 ++-
 src/java/org/apache/cassandra/db/SystemKeyspace.java  |  3 ++-
 .../cassandra/db/compaction/CompactionTask.java   |  6 +++---
 .../org/apache/cassandra/service/StorageService.java  |  5 +++--
 .../cassandra/service/snapshot/SnapshotManager.java   |  3 ++-
 src/java/org/apache/cassandra/utils/Clock.java|  1 -
 src/java/org/apache/cassandra/utils/FBUtilities.java  |  7 +++
 .../cassandra/distributed/test/ResourceLeakTest.java  |  4 ++--
 .../unit/org/apache/cassandra/db/DirectoriesTest.java |  5 +++--
 .../service/snapshot/SnapshotManagerTest.java | 15 ++-
 .../cassandra/service/snapshot/TableSnapshotTest.java | 19 ++-
 .../cassandra/utils/concurrent/LoadingMapTest.java|  5 +++--
 14 files changed, 58 insertions(+), 39 deletions(-)

diff --git a/checkstyle.xml b/checkstyle.xml
index 19bfa86..5efe0fc 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -62,6 +62,15 @@
   
   
 
+
+
+  
+  
+  
+  
+  
+
+
 
   
   
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java 
b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index aa2b165..cc0c294 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -113,6 +113,7 @@ import static 
org.apache.cassandra.db.commitlog.CommitLog.instance;
 import static org.apache.cassandra.db.commitlog.CommitLogPosition.NONE;
 import static org.apache.cassandra.utils.Clock.Global.currentTimeMillis;
 import static org.apache.cassandra.utils.Clock.Global.nanoTime;
+import static org.apache.cassandra.utils.FBUtilities.now;
 import static org.apache.cassandra.utils.Throwables.maybeFail;
 import static org.apache.cassandra.utils.Throwables.merge;
 import static 
org.apache.cassandra.utils.concurrent.CountDownLatch.newCountDownLatch;
@@ -1539,9 +1540,8 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 // skip snapshot creation during scrub, SEE JIRA 5891
 if(!disableSnapshot)
 {
-long epochMilli = currentTimeMillis();
-Instant creationTime = Instant.ofEpochMilli(epochMilli);
-String snapshotName = "pre-scrub-" + epochMilli;
+Instant creationTime = now();
+String snapshotName = "pre-scrub-" + creationTime.toEpochMilli();
 snapshotWithoutFlush(snapshotName, creationTime);
 }
 
@@ -1858,7 +1858,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
 
 public TableSnapshot snapshotWithoutFlush(String snapshotName)
 {
-return snapshotWithoutFlush(snapshotName, Instant.now());
+return snapshotWithoutFlush(snapshotName, now());
 }
 
 public TableSnapshot snapshotWithoutFlush(String snapshotName, Instant 
creationTime)
@@ -2051,7 +2051,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
  */
 public TableSnapshot snapshot(String snapshotName)
 {
-return snapshot(snapshotName, false, null, null, Instant.now());
+return snapshot(snapshotName, false, null, null, now());
 }
 
 /**
@@ -2075,7 +2075,7 @@ public class ColumnFamilyStore implements 
ColumnFamilyStoreMBean
  */
 public TableSnapshot snapshot(String snapshotName, 
Predicate predicate, boolean ephemeral, boolean skipFlush)
 {
-return snapshot(snapshotName, predicate, ephemeral, skipFlush, null, 
null, Instant.now());
+return snapshot(snapshotName, predicate, ephemeral, skipFlush, null, 
null, now());
 }
 
 /**
diff --git a/src/java/org/apache/cassandra/db/Keyspace.java 
b/src/java/org/apache/cassandra/db/Keyspace.java
index 606e7e8..4ef3d02 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -77,6 +77,7 @@ import org.apache.cassandra.utils.concurrent.Promise;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.NANOSECONDS;
 import static org.apache.cassandra.utils.Clock.Global.currentTimeMillis;
+import static org.apache.cassandra.utils.FBUtilities

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

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit c69e37eca76d96c331807ea23280945afecad1e9
Merge: 9a8dc6d 702824a
Author: Marcus Eriksson 
AuthorDate: Thu Feb 17 10:39:33 2022 +0100

Merge branch 'cassandra-4.0' into trunk

 CHANGES.txt|   2 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 161 -
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 +-
 9 files changed, 271 insertions(+), 18 deletions(-)

diff --cc CHANGES.txt
index 6a43be1,4fa9ba3..85204fc
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,98 -1,7 +1,100 @@@
 +4.1
 + * Fix improper CDC commit log segments deletion in non-blocking mode 
(CASSANDRA-17233)
 + * Add support for string concatenations through the + operator 
(CASSANDRA-17190)
 + * Limit the maximum hints size per host (CASSANDRA-17142)
 + * Add a virtual table for exposing batch metrics (CASSANDRA-17225)
 + * Flatten guardrails config (CASSANDRA-17353)
 + * Instance failed to start up due to NPE in 
StartupClusterConnectivityChecker (CASSANDRA-17347)
 + * add the shorter version of version flag (-v) in cqlsh (CASSANDRA-17236)
 + * Make vtables accessible via internode messaging (CASSANDRA-17295)
 + * Add support for PEM based key material for SSL (CASSANDRA-17031)
 + * Standardize storage configuration parameters' names. Support unit 
suffixes. (CASSANDRA-15234)
 + * Remove support for Windows (CASSANDRA-16956)
 + * Runtime-configurable YAML option to prohibit USE statements 
(CASSANDRA-17318)
 + * When streaming sees a ClosedChannelException this triggers the disk 
failure policy (CASSANDRA-17116)
 + * Add a virtual table for exposing prepared statements metrics 
(CASSANDRA-17224)
 + * Remove python 2.x support from cqlsh (CASSANDRA-17242)
 + * Prewarm role and credential caches to avoid timeouts at startup 
(CASSANDRA-16958)
 + * Make capacity/validity/updateinterval/activeupdate for Auth Caches 
configurable via nodetool (CASSANDRA-17063)
 + * Added startup check for read_ahead_kb setting (CASSANDRA-16436)
 + * Avoid unecessary array allocations and initializations when performing 
query checks (CASSANDRA-17209)
 + * Add guardrail for list operations that require read before write 
(CASSANDRA-17154)
 + * Migrate thresholds for number of keyspaces and tables to guardrails 
(CASSANDRA-17195)
 + * Remove self-reference in SSTableTidier (CASSANDRA-17205)
 + * Add guardrail for query page size (CASSANDRA-17189)
 + * Allow column_index_size_in_kb to be configurable through nodetool 
(CASSANDRA-17121)
 + * Emit a metric for number of local read and write calls
 + * Add non-blocking mode for CDC writes (CASSANDRA-17001)
 + * Add guardrails framework (CASSANDRA-17147)
 + * Harden resource management on SSTable components to prevent future leaks 
(CASSANDRA-17174)
 + * Make nodes more resilient to local unrelated files during startup 
(CASSANDRA-17082)
 + * repair prepare message would produce a wrong error message if network 
timeout happened rather than reply wait timeout (CASSANDRA-16992)
 + * Log queries that fail on timeout or unavailable errors up to once per 
minute by default (CASSANDRA-17159)
 + * Refactor normal/preview/IR repair to standardize repair cleanup and error 
handling of failed RepairJobs (CASSANDRA-17069)
 + * Log missing peers in StartupClusterConnectivityChecker (CASSANDRA-17130)
 + * Introduce separate rate limiting settings for entire SSTable streaming 
(CASSANDRA-17065)
 + * Implement Virtual Tables for Auth Caches (CASSANDRA-16914)
 + * Actively update auth cache in the background (CASSANDRA-16957)
 + * Add unix time conversion functions (CASSANDRA-17029)
 + * JVMStabilityInspector.forceHeapSpaceOomMaybe should handle all non-heap 
OOMs rather than only supporting direct only (CASSANDRA-17128)
 + * Forbid other Future implementations with checkstyle (CASSANDRA-17055)
 + * commit log was switched from non-daemon to daemon threads, which causes 
the JVM to exit in some case as no non-daemon threads are active 
(CASSANDRA-17085)
 + * Add a Denylist to block reads and writes on specific partition keys 
(CASSANDRA-12106)
 + * v4+ protocol did not clean up client warnings, which caused leaking the 
state (CASSANDRA-17054)
 + * Remove duplicate toCQLString in ReadCommand (CASSANDRA-17023)
 + * Ensure hint window is persistent across restarts of a node 
(CASSANDRA-14309)
 + * Allow to GRANT or REVOKE multiple permissions in a single statement 
(CASSANDRA-17030)
 + * Allow to grant permission for all tab

[cassandra] branch trunk updated (9a8dc6d -> c69e37e)

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 9a8dc6d  Merge branch 'cassandra-4.0' into trunk
 new b58a5c8  LeveledCompactionStrategy disk space check improvements
 new e53ad64  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 702824a  Merge branch 'cassandra-3.11' into cassandra-4.0
 new c69e37e  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:
 CHANGES.txt|   2 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 161 -
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 +-
 9 files changed, 271 insertions(+), 18 deletions(-)
 rename test/unit/org/apache/cassandra/db/compaction/{ => 
writers}/CompactionAwareWriterTest.java (84%)

-
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

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 702824a99ddf890603113992b09bf5c7780f6a6d
Merge: 894d33c e53ad64
Author: Marcus Eriksson 
AuthorDate: Thu Feb 17 10:33:48 2022 +0100

Merge branch 'cassandra-3.11' into cassandra-4.0

 CHANGES.txt|   2 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 161 -
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 +-
 9 files changed, 271 insertions(+), 18 deletions(-)

diff --cc CHANGES.txt
index c64b602,513a8af..4fa9ba3
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,46 -1,21 +1,48 @@@
 -3.11.13
 +4.0.4
+ Merged from 3.0:
   * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
+  * LeveledCompactionStrategy disk space check improvements (CASSANDRA-17272)
  
 +4.0.3
 + * Deprecate otc_coalescing_strategy, otc_coalescing_window_us, 
otc_coalescing_enough_coalesced_messages,
 +   otc_backlog_expiration_interval_ms (CASSANDRA-17377)
 + * Improve start up processing of Incremental Repair information read from 
system.repairs (CASSANDRA-17342)
  
 -3.11.12
 - * Upgrade snakeyaml to 1.26 in 3.11 (CASSANDRA=17028)
 +4.0.2
 + * Full Java 11 support (CASSANDRA-16894)
 + * Remove unused 'geomet' package from cqlsh path (CASSANDRA-17271)
 + * Removed unused 'cql' dependency (CASSANDRA-17247)
 + * Don't block gossip when clearing repair snapshots (CASSANDRA-17168)
 + * Deduplicate warnings for deprecated parameters (changed names) 
(CASSANDRA-17160)
 + * Update ant-junit to version 1.10.12 (CASSANDRA-17218)
 + * Add droppable tombstone metrics to nodetool tablestats (CASSANDRA-16308)
 + * Fix disk failure triggered when enabling FQL on an unclean directory 
(CASSANDRA-17136)
 + * Fixed broken classpath when multiple jars in build directory 
(CASSANDRA-17129)
 + * DebuggableThreadPoolExecutor does not propagate client warnings 
(CASSANDRA-17072)
 + * internode_send_buff_size_in_bytes and internode_recv_buff_size_in_bytes 
have new names. Backward compatibility with the old names added 
(CASSANDRA-17141)
 + * Remove unused configuration parameters from cassandra.yaml 
(CASSANDRA-17132)
 + * Queries performed with NODE_LOCAL consistency level do not update request 
metrics (CASSANDRA-17052)
 + * Fix multiple full sources can be select unexpectedly for bootstrap 
streaming (CASSANDRA-16945)
 + * Fix cassandra.yaml formatting of parameters (CASSANDRA-17131)
 + * Add backward compatibility for CQLSSTableWriter Date fields 
(CASSANDRA-17117)
 + * Push initial client connection messages to trace (CASSANDRA-17038)
 + * Correct the internode message timestamp if sending node has wrapped 
(CASSANDRA-16997)
 + * Avoid race causing us to return null in RangesAtEndpoint (CASSANDRA-16965)
 + * Avoid rewriting all sstables during cleanup when transient replication is 
enabled (CASSANDRA-16966)
 + * Prevent CQLSH from failure on Python 3.10 (CASSANDRA-16987)
 + * Avoid trying to acquire 0 permits from the rate limiter when taking 
snapshot (CASSANDRA-16872)
 + * Upgrade Caffeine to 2.5.6 (CASSANDRA-15153)
 + * Include SASI components to snapshots (CASSANDRA-15134)
 + * Fix missed wait latencies in the output of `nodetool tpstats -F` 
(CASSANDRA-16938)
 + * Remove all the state pollution between tests in SSTableReaderTest 
(CASSANDRA-16888)
 + * Delay auth setup until after gossip has settled to avoid unavailables on 
startup (CASSANDRA-16783)
 + * Fix clustering order logic in CREATE MATERIALIZED VIEW (CASSANDRA-16898)
 + * org.apache.cassandra.db.rows.ArrayCell#unsharedHeapSizeExcludingData 
includes data twice (CASSANDRA-16900)
 + * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 +Merged from 3.11:
   * Add key validation to ssstablescrub (CASSANDRA-16969)
   * Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851)
 - * Include SASI components to snapshots (CASSANDRA-15134)
   * Make assassinate more resilient to missing tokens (CASSANDRA-16847)
 - * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 - * Validate SASI tokenizer options before adding index to schema 
(CASSANDRA-15135)
 - * Fixup scrub output when no data post-scrub and clear up old use of row, 
which really means partition (CASSANDRA-16835)
 - * Fix ant-junit dependency issue (CASSANDRA-16827)
 - * Reduce thread contention in CommitLogSegment and HintsBuffer 
(CASSANDRA-16072)
 - * Av

[cassandra] branch cassandra-3.11 updated (f0bb299 -> e53ad64)

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from f0bb299  Merge branch 'cassandra-3.0' into cassandra-3.11
 new b58a5c8  LeveledCompactionStrategy disk space check improvements
 new e53ad64  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:
 CHANGES.txt|   1 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 152 +
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 ++-
 9 files changed, 267 insertions(+), 12 deletions(-)
 rename test/unit/org/apache/cassandra/db/compaction/{ => 
writers}/CompactionAwareWriterTest.java (84%)

-
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: LeveledCompactionStrategy disk space check improvements

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 b58a5c8  LeveledCompactionStrategy disk space check improvements
b58a5c8 is described below

commit b58a5c86e89e10ad4d39756c5314a756eb18204d
Author: Marcus Eriksson 
AuthorDate: Thu Jan 20 14:18:46 2022 +0100

LeveledCompactionStrategy disk space check improvements

Patch by marcuse; reviewed by Caleb Rackliffe for CASSANDRA-17272
---
 CHANGES.txt|   2 +
 .../cassandra/db/compaction/CompactionTask.java|   5 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   8 +-
 .../compaction/writers/MaxSSTableSizeWriter.java   |   8 +-
 .../SplittingSizeTieredCompactionWriter.java   |   9 +-
 test/unit/org/apache/cassandra/MockSchema.java |   3 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 161 -
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 +-
 10 files changed, 278 insertions(+), 18 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 527450d..4d07a3d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,8 @@
 3.0.27
+ * LeveledCompactionStrategy disk space check improvements (CASSANDRA-17272)
  * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
 
+
 3.0.26
  * Fix conversion from megabits to bytes in streaming rate limiter 
(CASSANDRA-17243)
  * Upgrade logback to 1.2.9 (CASSANDRA-17204)
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java 
b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index d29d5e6..d023cef 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -95,9 +95,10 @@ public class CompactionTask extends AbstractCompactionTask
 if (partialCompactionsAcceptable() && transaction.originals().size() > 
1)
 {
 // Try again w/o the largest one.
-logger.warn("insufficient space to compact all requested files. 
{}MB required, {}",
+logger.warn("insufficient space to compact all requested files. 
{}MB required, {} for compaction {}",
 (float) expectedSize / 1024 / 1024,
-StringUtils.join(transaction.originals(), ", "));
+StringUtils.join(transaction.originals(), ", "),
+transaction.opId());
 // Note that we have removed files that are still marked as 
compacting.
 // This suboptimal but ok since the caller will unmark all the 
sstables at the end.
 SSTableReader removedSSTable = 
cfs.getMaxSizeFile(transaction.originals());
diff --git 
a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionTask.java 
b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionTask.java
index f8c3521..20ff21c 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionTask.java
@@ -18,6 +18,7 @@
 package org.apache.cassandra.db.compaction;
 
 import java.util.Set;
+import java.util.stream.Collectors;
 
 import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.Directories;
@@ -55,11 +56,53 @@ public class LeveledCompactionTask extends CompactionTask
 @Override
 protected boolean partialCompactionsAcceptable()
 {
-return level == 0;
+throw new UnsupportedOperationException("This is now handled in 
reduceScopeForLimitedSpace");
 }
 
 protected int getLevel()
 {
 return level;
 }
+
+@Override
+public boolean reduceScopeForLimitedSpace(long expectedSize)
+{
+if (transaction.originals().size() > 1 && level <= 1)
+{
+// Try again w/o the largest one.
+logger.warn("insufficient space to do L0 -> L{} compaction. {}MiB 
required, {} for compaction {}",
+level,
+(float) expectedSize / 1024 / 1024,
+transaction.originals()
+   .stream()
+   .map(sstable -> String.format("%s 
(level=%s, size=%s)", sstable, sstable.getSSTableLevel(), 
sstable.onDiskLength()))
+   .collect(Collectors.joining(",")),
+transaction.opId());
+// Note that we have removed files that are still marked as 
compacting.
+// Thi

[cassandra] branch cassandra-4.0 updated (894d33c -> 702824a)

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 894d33c  Increment version to 4.0.4
 new b58a5c8  LeveledCompactionStrategy disk space check improvements
 new e53ad64  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 702824a  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:
 CHANGES.txt|   2 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 161 -
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 +-
 9 files changed, 271 insertions(+), 18 deletions(-)
 rename test/unit/org/apache/cassandra/db/compaction/{ => 
writers}/CompactionAwareWriterTest.java (84%)

-
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

2022-02-17 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit e53ad6461224b1ab096f56d9e2c744126eb532cd
Merge: f0bb299 b58a5c8
Author: Marcus Eriksson 
AuthorDate: Thu Feb 17 10:30:05 2022 +0100

Merge branch 'cassandra-3.0' into cassandra-3.11

 CHANGES.txt|   1 +
 .../cassandra/db/compaction/CompactionTask.java|   6 +-
 .../db/compaction/LeveledCompactionTask.java   |  45 +-
 .../compaction/writers/CompactionAwareWriter.java  |   7 +-
 .../writers/MajorLeveledCompactionWriter.java  |   6 +
 .../compaction/writers/MaxSSTableSizeWriter.java   |   6 +
 .../SplittingSizeTieredCompactionWriter.java   |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  | 152 +
 .../{ => writers}/CompactionAwareWriterTest.java   |  48 ++-
 9 files changed, 267 insertions(+), 12 deletions(-)

diff --cc CHANGES.txt
index 402048f,4d07a3d..513a8af
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,21 -1,9 +1,22 @@@
 -3.0.27
 - * LeveledCompactionStrategy disk space check improvements (CASSANDRA-17272)
 +3.11.13
 +Merged from 3.0:
   * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
++ * LeveledCompactionStrategy disk space check improvements (CASSANDRA-17272)
  
  
 -3.0.26
 +3.11.12
 + * Upgrade snakeyaml to 1.26 in 3.11 (CASSANDRA=17028)
 + * Add key validation to ssstablescrub (CASSANDRA-16969)
 + * Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851)
 + * Include SASI components to snapshots (CASSANDRA-15134)
 + * Make assassinate more resilient to missing tokens (CASSANDRA-16847)
 + * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 + * Validate SASI tokenizer options before adding index to schema 
(CASSANDRA-15135)
 + * Fixup scrub output when no data post-scrub and clear up old use of row, 
which really means partition (CASSANDRA-16835)
 + * Fix ant-junit dependency issue (CASSANDRA-16827)
 + * Reduce thread contention in CommitLogSegment and HintsBuffer 
(CASSANDRA-16072)
 + * Avoid sending CDC column if not enabled (CASSANDRA-16770)
 +Merged from 3.0:
   * Fix conversion from megabits to bytes in streaming rate limiter 
(CASSANDRA-17243)
   * Upgrade logback to 1.2.9 (CASSANDRA-17204)
   * Avoid race in AbstractReplicationStrategy endpoint caching 
(CASSANDRA-16673)
diff --cc 
src/java/org/apache/cassandra/db/compaction/writers/CompactionAwareWriter.java
index bc6115e,1ceed1c..7ffe33a
--- 
a/src/java/org/apache/cassandra/db/compaction/writers/CompactionAwareWriter.java
+++ 
b/src/java/org/apache/cassandra/db/compaction/writers/CompactionAwareWriter.java
@@@ -158,26 -124,9 +158,26 @@@ public abstract class CompactionAwareWr
   */
  protected void maybeSwitchWriter(DecoratedKey key)
  {
 -if (!isInitialized)
 -
switchCompactionLocation(getDirectories().getWriteableLocation(getExpectedWriteSize()));
 -isInitialized = true;
 +if (diskBoundaries == null)
 +{
 +if (locationIndex < 0)
 +{
- Directories.DataDirectory defaultLocation = 
getWriteDirectory(nonExpiredSSTables, 
cfs.getExpectedCompactedFileSize(nonExpiredSSTables, OperationType.UNKNOWN));
++Directories.DataDirectory defaultLocation = 
getWriteDirectory(nonExpiredSSTables, getExpectedWriteSize());
 +switchCompactionLocation(defaultLocation);
 +locationIndex = 0;
 +}
 +return;
 +}
 +
 +if (locationIndex > -1 && 
key.compareTo(diskBoundaries.get(locationIndex)) < 0)
 +return;
 +
 +int prevIdx = locationIndex;
 +while (locationIndex == -1 || 
key.compareTo(diskBoundaries.get(locationIndex)) > 0)
 +locationIndex++;
 +if (prevIdx >= 0)
 +logger.debug("Switching write location from {} to {}", 
locations.get(prevIdx), locations.get(locationIndex));
 +switchCompactionLocation(locations.get(locationIndex));
  }
  
  /**
@@@ -198,45 -147,18 +198,50 @@@
  
  /**
   * Return a directory where we can expect expectedWriteSize to fit.
 + *
 + * @param sstables the sstables to compact
 + * @return
   */
 -public Directories.DataDirectory getWriteDirectory(long expectedWriteSize)
 +public Directories.DataDirectory 
getWriteDirectory(Iterable sstables, long estimatedWriteSize)
  {
 -Directories.DataDirectory directory = 
getDirectories().getWriteableLocation(expectedWriteSize);
 -if (directory == null)
 -throw new RuntimeException("Insufficient disk space to write " + 
expectedWriteSize + " bytes");
 +Descriptor descriptor = null;
 +for (SSTableReader sstable : ss

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

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit e56bf105a161b1d9677ea4c9c70436f3169edb9c
Merge: 81922c5 2687cf1
Author: Marcus Eriksson 
AuthorDate: Wed Feb 16 11:09:55 2022 +0100

Merge branch 'cassandra-4.0' into trunk

 CHANGES.txt|  8 +-
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 22 +++---
 .../cassandra/db/lifecycle/LogTransactionTest.java | 91 +++---
 3 files changed, 82 insertions(+), 39 deletions(-)

diff --cc CHANGES.txt
index 51e39bf,c64b602..9043898
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,95 -1,9 +1,101 @@@
 +4.1
 + * Add support for string concatenations through the + operator 
(CASSANDRA-17190)
 + * Limit the maximum hints size per host (CASSANDRA-17142)
 + * Add a virtual table for exposing batch metrics (CASSANDRA-17225)
 + * Flatten guardrails config (CASSANDRA-17353)
 + * Instance failed to start up due to NPE in 
StartupClusterConnectivityChecker (CASSANDRA-17347)
 + * add the shorter version of version flag (-v) in cqlsh (CASSANDRA-17236)
 + * Make vtables accessible via internode messaging (CASSANDRA-17295)
 + * Add support for PEM based key material for SSL (CASSANDRA-17031)
 + * Standardize storage configuration parameters' names. Support unit 
suffixes. (CASSANDRA-15234)
 + * Remove support for Windows (CASSANDRA-16956)
 + * Runtime-configurable YAML option to prohibit USE statements 
(CASSANDRA-17318)
 + * When streaming sees a ClosedChannelException this triggers the disk 
failure policy (CASSANDRA-17116)
 + * Add a virtual table for exposing prepared statements metrics 
(CASSANDRA-17224)
 + * Remove python 2.x support from cqlsh (CASSANDRA-17242)
 + * Prewarm role and credential caches to avoid timeouts at startup 
(CASSANDRA-16958)
 + * Make capacity/validity/updateinterval/activeupdate for Auth Caches 
configurable via nodetool (CASSANDRA-17063)
 + * Added startup check for read_ahead_kb setting (CASSANDRA-16436)
 + * Avoid unecessary array allocations and initializations when performing 
query checks (CASSANDRA-17209)
 + * Add guardrail for list operations that require read before write 
(CASSANDRA-17154)
 + * Migrate thresholds for number of keyspaces and tables to guardrails 
(CASSANDRA-17195)
 + * Remove self-reference in SSTableTidier (CASSANDRA-17205)
 + * Add guardrail for query page size (CASSANDRA-17189)
 + * Allow column_index_size_in_kb to be configurable through nodetool 
(CASSANDRA-17121)
 + * Emit a metric for number of local read and write calls
 + * Add non-blocking mode for CDC writes (CASSANDRA-17001)
 + * Add guardrails framework (CASSANDRA-17147)
 + * Harden resource management on SSTable components to prevent future leaks 
(CASSANDRA-17174)
 + * Make nodes more resilient to local unrelated files during startup 
(CASSANDRA-17082)
 + * repair prepare message would produce a wrong error message if network 
timeout happened rather than reply wait timeout (CASSANDRA-16992)
 + * Log queries that fail on timeout or unavailable errors up to once per 
minute by default (CASSANDRA-17159)
 + * Refactor normal/preview/IR repair to standardize repair cleanup and error 
handling of failed RepairJobs (CASSANDRA-17069)
 + * Log missing peers in StartupClusterConnectivityChecker (CASSANDRA-17130)
 + * Introduce separate rate limiting settings for entire SSTable streaming 
(CASSANDRA-17065)
 + * Implement Virtual Tables for Auth Caches (CASSANDRA-16914)
 + * Actively update auth cache in the background (CASSANDRA-16957)
 + * Add unix time conversion functions (CASSANDRA-17029)
 + * JVMStabilityInspector.forceHeapSpaceOomMaybe should handle all non-heap 
OOMs rather than only supporting direct only (CASSANDRA-17128)
 + * Forbid other Future implementations with checkstyle (CASSANDRA-17055)
 + * commit log was switched from non-daemon to daemon threads, which causes 
the JVM to exit in some case as no non-daemon threads are active 
(CASSANDRA-17085)
 + * Add a Denylist to block reads and writes on specific partition keys 
(CASSANDRA-12106)
 + * v4+ protocol did not clean up client warnings, which caused leaking the 
state (CASSANDRA-17054)
 + * Remove duplicate toCQLString in ReadCommand (CASSANDRA-17023)
 + * Ensure hint window is persistent across restarts of a node 
(CASSANDRA-14309)
 + * Allow to GRANT or REVOKE multiple permissions in a single statement 
(CASSANDRA-17030)
 + * Allow to grant permission for all tables in a keyspace (CASSANDRA-17027)
 + * Log time spent writing keys during compaction (CASSANDRA-17037)
 + * Make nodetool compactionstats and sstable_tasks consistent 
(CASSANDRA-16976)
 + * Add metrics and logging around index summary redistribution 
(CASSANDRA-17036)
 + * Add configuration options for minimum allowable replication factor and 
default replication factor (CASSANDRA-14557)
 + * Expose information about stored hints via a nodetool command

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

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit eeec360e757c191c517ddb51154c7c4f8d283d88
Merge: 0218d1f 85c202d
Author: Marcus Eriksson 
AuthorDate: Wed Feb 16 10:14:41 2022 +0100

Merge branch 'cassandra-3.0' into cassandra-3.11

 CHANGES.txt|  2 +
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 24 +
 .../cassandra/db/lifecycle/LogTransactionTest.java | 60 ++
 3 files changed, 65 insertions(+), 21 deletions(-)

diff --cc CHANGES.txt
index c166202,527450d..402048f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,19 -1,7 +1,21 @@@
 -3.0.27
 +3.11.13
++Merged from 3.0:
+  * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
  
 -3.0.26
 +
 +3.11.12
 + * Upgrade snakeyaml to 1.26 in 3.11 (CASSANDRA=17028)
 + * Add key validation to ssstablescrub (CASSANDRA-16969)
 + * Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851)
 + * Include SASI components to snapshots (CASSANDRA-15134)
 + * Make assassinate more resilient to missing tokens (CASSANDRA-16847)
 + * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 + * Validate SASI tokenizer options before adding index to schema 
(CASSANDRA-15135)
 + * Fixup scrub output when no data post-scrub and clear up old use of row, 
which really means partition (CASSANDRA-16835)
 + * Fix ant-junit dependency issue (CASSANDRA-16827)
 + * Reduce thread contention in CommitLogSegment and HintsBuffer 
(CASSANDRA-16072)
 + * Avoid sending CDC column if not enabled (CASSANDRA-16770)
 +Merged from 3.0:
   * Fix conversion from megabits to bytes in streaming rate limiter 
(CASSANDRA-17243)
   * Upgrade logback to 1.2.9 (CASSANDRA-17204)
   * Avoid race in AbstractReplicationStrategy endpoint caching 
(CASSANDRA-16673)
diff --cc src/java/org/apache/cassandra/db/lifecycle/LogFile.java
index 39bfaa9,42d81ca..3550d66
--- a/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
@@@ -345,11 -341,15 +342,15 @@@ final class LogFile implements AutoClos
  private LogRecord makeRecord(Type type, SSTable table, LogRecord record)
  {
  assert type == Type.ADD || type == Type.REMOVE;
+ maybeCreateReplica(table);
+ return record.asType(type);
+ }
  
- File directory = table.descriptor.directory;
+ private void maybeCreateReplica(SSTable sstable)
+ {
 -File folder = sstable.descriptor.directory;
 -String fileName = getFileName(folder);
 -replicas.maybeCreateReplica(folder, fileName, onDiskRecords);
++File directory = sstable.descriptor.directory;
 +String fileName = StringUtils.join(directory, File.separator, 
getFileName());
- replicas.maybeCreateReplica(directory, fileName, records);
- return record.asType(type);
++replicas.maybeCreateReplica(directory, fileName, onDiskRecords);
  }
  
  void addRecord(LogRecord record)
diff --cc test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
index c727241,6fb2334..09c75e1
--- a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
@@@ -44,15 -44,18 +44,16 @@@ import org.apache.cassandra.MockSchema
  import org.apache.cassandra.db.ColumnFamilyStore;
  import org.apache.cassandra.db.Directories;
  import org.apache.cassandra.db.SerializationHeader;
- import org.apache.cassandra.db.compaction.*;
- import org.apache.cassandra.io.sstable.*;
+ import org.apache.cassandra.db.compaction.OperationType;
+ import org.apache.cassandra.io.sstable.Component;
+ import org.apache.cassandra.io.sstable.Descriptor;
 +import org.apache.cassandra.io.sstable.format.SSTableFormat;
  import org.apache.cassandra.io.sstable.format.SSTableReader;
  import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
  import org.apache.cassandra.io.sstable.metadata.MetadataType;
  import org.apache.cassandra.io.sstable.metadata.StatsMetadata;
- import org.apache.cassandra.io.util.FileUtils;
 -import org.apache.cassandra.io.util.BufferedSegmentedFile;
 -import org.apache.cassandra.io.util.ChannelProxy;
 +import org.apache.cassandra.io.util.FileHandle;
+ import org.apache.cassandra.io.util.FileUtils;
 -import org.apache.cassandra.io.util.RandomAccessReader;
 -import org.apache.cassandra.io.util.SegmentedFile;
  import org.apache.cassandra.utils.AlwaysPresentFilter;
  import org.apache.cassandra.utils.concurrent.AbstractTransactionalTest;
  import org.apache.cassandra.utils.concurrent.Transactional;

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

[cassandra] branch trunk updated (81922c5 -> e56bf10)

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 81922c5  Intoduce Harry to the tree
 new 85c202d  Lazy transaction log replica creation allows incorrect 
replica content divergence during anticompaction
 new eeec360  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 2687cf1  Merge branch 'cassandra-3.11' into cassandra-4.0
 new e56bf10  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:
 CHANGES.txt|  8 +-
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 22 +++---
 .../cassandra/db/lifecycle/LogTransactionTest.java | 91 +++---
 3 files changed, 82 insertions(+), 39 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-3.11' into cassandra-4.0

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 2687cf1edf5d61379475f5a4e65a112239649b8a
Merge: a87055d eeec360
Author: Marcus Eriksson 
AuthorDate: Wed Feb 16 10:17:14 2022 +0100

Merge branch 'cassandra-3.11' into cassandra-4.0

 CHANGES.txt|  3 +
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 22 +++---
 .../cassandra/db/lifecycle/LogTransactionTest.java | 86 --
 3 files changed, 76 insertions(+), 35 deletions(-)

diff --cc CHANGES.txt
index 937bedf,402048f..c64b602
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,43 -1,20 +1,46 @@@
 -3.11.13
 -Merged from 3.0:
++4.0.4
+  * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
+ 
 +4.0.3
 + * Deprecate otc_coalescing_strategy, otc_coalescing_window_us, 
otc_coalescing_enough_coalesced_messages,
 +   otc_backlog_expiration_interval_ms (CASSANDRA-17377)
 + * Improve start up processing of Incremental Repair information read from 
system.repairs (CASSANDRA-17342)
  
 -3.11.12
 - * Upgrade snakeyaml to 1.26 in 3.11 (CASSANDRA=17028)
 +4.0.2
 + * Full Java 11 support (CASSANDRA-16894)
 + * Remove unused 'geomet' package from cqlsh path (CASSANDRA-17271)
 + * Removed unused 'cql' dependency (CASSANDRA-17247)
 + * Don't block gossip when clearing repair snapshots (CASSANDRA-17168)
 + * Deduplicate warnings for deprecated parameters (changed names) 
(CASSANDRA-17160)
 + * Update ant-junit to version 1.10.12 (CASSANDRA-17218)
 + * Add droppable tombstone metrics to nodetool tablestats (CASSANDRA-16308)
 + * Fix disk failure triggered when enabling FQL on an unclean directory 
(CASSANDRA-17136)
 + * Fixed broken classpath when multiple jars in build directory 
(CASSANDRA-17129)
 + * DebuggableThreadPoolExecutor does not propagate client warnings 
(CASSANDRA-17072)
 + * internode_send_buff_size_in_bytes and internode_recv_buff_size_in_bytes 
have new names. Backward compatibility with the old names added 
(CASSANDRA-17141)
 + * Remove unused configuration parameters from cassandra.yaml 
(CASSANDRA-17132)
 + * Queries performed with NODE_LOCAL consistency level do not update request 
metrics (CASSANDRA-17052)
 + * Fix multiple full sources can be select unexpectedly for bootstrap 
streaming (CASSANDRA-16945)
 + * Fix cassandra.yaml formatting of parameters (CASSANDRA-17131)
 + * Add backward compatibility for CQLSSTableWriter Date fields 
(CASSANDRA-17117)
 + * Push initial client connection messages to trace (CASSANDRA-17038)
 + * Correct the internode message timestamp if sending node has wrapped 
(CASSANDRA-16997)
 + * Avoid race causing us to return null in RangesAtEndpoint (CASSANDRA-16965)
 + * Avoid rewriting all sstables during cleanup when transient replication is 
enabled (CASSANDRA-16966)
 + * Prevent CQLSH from failure on Python 3.10 (CASSANDRA-16987)
 + * Avoid trying to acquire 0 permits from the rate limiter when taking 
snapshot (CASSANDRA-16872)
 + * Upgrade Caffeine to 2.5.6 (CASSANDRA-15153)
 + * Include SASI components to snapshots (CASSANDRA-15134)
 + * Fix missed wait latencies in the output of `nodetool tpstats -F` 
(CASSANDRA-16938)
 + * Remove all the state pollution between tests in SSTableReaderTest 
(CASSANDRA-16888)
 + * Delay auth setup until after gossip has settled to avoid unavailables on 
startup (CASSANDRA-16783)
 + * Fix clustering order logic in CREATE MATERIALIZED VIEW (CASSANDRA-16898)
 + * org.apache.cassandra.db.rows.ArrayCell#unsharedHeapSizeExcludingData 
includes data twice (CASSANDRA-16900)
 + * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 +Merged from 3.11:
   * Add key validation to ssstablescrub (CASSANDRA-16969)
   * Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851)
 - * Include SASI components to snapshots (CASSANDRA-15134)
   * Make assassinate more resilient to missing tokens (CASSANDRA-16847)
 - * Exclude Jackson 1.x transitive dependency of hadoop* provided dependencies 
(CASSANDRA-16854)
 - * Validate SASI tokenizer options before adding index to schema 
(CASSANDRA-15135)
 - * Fixup scrub output when no data post-scrub and clear up old use of row, 
which really means partition (CASSANDRA-16835)
 - * Fix ant-junit dependency issue (CASSANDRA-16827)
 - * Reduce thread contention in CommitLogSegment and HintsBuffer 
(CASSANDRA-16072)
 - * Avoid sending CDC column if not enabled (CASSANDRA-16770)
  Merged from 3.0:
   * Fix conversion from megabits to bytes in streaming rate limiter 
(CASSANDRA-17243)
   * Upgrade logback to 1.2.9 (CASSANDRA-17204)
diff --cc src/java/org/apache/cassandra/db/lifecycle/LogFile.java
index a91af73,3550d66..9053034
--- a/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
@@@ -66,7 -66,10 +66,8

[cassandra] branch cassandra-3.11 updated (0218d1f -> eeec360)

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 0218d1f  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 85c202d  Lazy transaction log replica creation allows incorrect 
replica content divergence during anticompaction
 new eeec360  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:
 CHANGES.txt|  2 +
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 24 +
 .../cassandra/db/lifecycle/LogTransactionTest.java | 60 ++
 3 files changed, 65 insertions(+), 21 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 (a87055d -> 2687cf1)

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from a87055d  Prepare debian changelog for 4.0.3
 new 85c202d  Lazy transaction log replica creation allows incorrect 
replica content divergence during anticompaction
 new eeec360  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 2687cf1  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:
 CHANGES.txt|  3 +
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 22 +++---
 .../cassandra/db/lifecycle/LogTransactionTest.java | 86 --
 3 files changed, 76 insertions(+), 35 deletions(-)

-
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: Lazy transaction log replica creation allows incorrect replica content divergence during anticompaction

2022-02-16 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 85c202d  Lazy transaction log replica creation allows incorrect 
replica content divergence during anticompaction
85c202d is described below

commit 85c202d8a8b037791db08c531f4f3c8336c82696
Author: Marcus Eriksson 
AuthorDate: Fri Jan 21 09:02:10 2022 +0100

Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction

Patch by marcuse; reviewed by Caleb Rackliffe for CASSANDRA-17273
---
 CHANGES.txt|  2 +-
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 23 +
 .../cassandra/db/lifecycle/LogTransactionTest.java | 58 ++
 3 files changed, 64 insertions(+), 19 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index f0fefb2..527450d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 3.0.27
-
+ * Lazy transaction log replica creation allows incorrect replica content 
divergence during anticompaction (CASSANDRA-17273)
 
 3.0.26
  * Fix conversion from megabits to bytes in streaming rate limiter 
(CASSANDRA-17243)
diff --git a/src/java/org/apache/cassandra/db/lifecycle/LogFile.java 
b/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
index ac64f13..42d81ca 100644
--- a/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
@@ -67,6 +67,9 @@ final class LogFile implements AutoCloseable
 
 // The transaction records, this set must be ORDER PRESERVING
 private final LinkedHashSet records = new LinkedHashSet<>();
+// the transaction records we have written to disk - used to guarantee 
that the
+// on-disk log files become identical when creating a new replica
+private final LinkedHashSet onDiskRecords = new 
LinkedHashSet<>();
 
 // The type of the transaction
 private final OperationType type;
@@ -320,17 +323,13 @@ final class LogFile implements AutoCloseable
 assert type == Type.ADD || type == Type.REMOVE;
 
 for (SSTableReader sstable : tables)
-{
-File folder = sstable.descriptor.directory;
-replicas.maybeCreateReplica(folder, getFileName(folder), records);
-}
+maybeCreateReplica(sstable);
 return LogRecord.make(type, tables);
 }
 
 private LogRecord makeAddRecord(SSTable table)
 {
-File folder = table.descriptor.directory;
-replicas.maybeCreateReplica(folder, getFileName(folder), records);
+maybeCreateReplica(table);
 return LogRecord.make(Type.ADD, table);
 }
 
@@ -342,12 +341,17 @@ final class LogFile implements AutoCloseable
 private LogRecord makeRecord(Type type, SSTable table, LogRecord record)
 {
 assert type == Type.ADD || type == Type.REMOVE;
-
-File folder = table.descriptor.directory;
-replicas.maybeCreateReplica(folder, getFileName(folder), records);
+maybeCreateReplica(table);
 return record.asType(type);
 }
 
+private void maybeCreateReplica(SSTable sstable)
+{
+File folder = sstable.descriptor.directory;
+String fileName = getFileName(folder);
+replicas.maybeCreateReplica(folder, fileName, onDiskRecords);
+}
+
 void addRecord(LogRecord record)
 {
 if (completed())
@@ -359,6 +363,7 @@ final class LogFile implements AutoCloseable
 replicas.append(record);
 if (!records.add(record))
 throw new IllegalStateException("Failed to add record");
+onDiskRecords.add(record);
 }
 
 void remove(SSTable table)
diff --git 
a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java 
b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
index 7ba1c39..6fb2334 100644
--- a/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
+++ b/test/unit/org/apache/cassandra/db/lifecycle/LogTransactionTest.java
@@ -22,7 +22,13 @@ import java.io.IOError;
 import java.io.IOException;
 import java.io.RandomAccessFile;
 import java.nio.file.Files;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
@@ -33,19 +39,14 @@ import com.google.common.collect.Sets;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.fail;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.asser

[cassandra] branch trunk updated (ab0a9fd -> 9649cb1)

2022-02-11 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from ab0a9fd  Merge branch 'cassandra-4.0' into trunk
 new c60ad61  Improve start up processing of Incremental Repair information 
read from system.repairs
 new 9649cb1  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:
 CHANGES.txt|   4 +-
 .../cassandra/repair/consistent/LocalSessions.java |  29 --
 .../cassandra/repair/consistent/RepairedState.java |  27 ++---
 ...pairStateTest.java => BulkRepairStateTest.java} | 110 ++---
 4 files changed, 83 insertions(+), 87 deletions(-)
 copy test/unit/org/apache/cassandra/repair/consistent/{RepairStateTest.java => 
BulkRepairStateTest.java} (50%)

-
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

2022-02-11 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 9649cb1358a08f5f98413c556ef2f69fb7806c91
Merge: ab0a9fd c60ad61
Author: Marcus Eriksson 
AuthorDate: Fri Feb 11 14:09:43 2022 +0100

Merge branch 'cassandra-4.0' into trunk

 CHANGES.txt|   4 +-
 .../cassandra/repair/consistent/LocalSessions.java |  29 +++-
 .../cassandra/repair/consistent/RepairedState.java |  27 +---
 .../repair/consistent/BulkRepairStateTest.java | 162 +
 4 files changed, 193 insertions(+), 29 deletions(-)

diff --cc CHANGES.txt
index 444625f,d41d293..2a313ab
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,96 -1,6 +1,96 @@@
 -4.0.3
 +4.1
 + * Limit the maximum hints size per host (CASSANDRA-17142)
 + * Add a virtual table for exposing batch metrics (CASSANDRA-17225)
 + * Flatten guardrails config (CASSANDRA-17353)
 + * Instance failed to start up due to NPE in 
StartupClusterConnectivityChecker (CASSANDRA-17347)
 + * add the shorter version of version flag (-v) in cqlsh (CASSANDRA-17236)
 + * Make vtables accessible via internode messaging (CASSANDRA-17295)
 + * Add support for PEM based key material for SSL (CASSANDRA-17031)
 + * Standardize storage configuration parameters' names. Support unit 
suffixes. (CASSANDRA-15234)
 + * Remove support for Windows (CASSANDRA-16956)
 + * Runtime-configurable YAML option to prohibit USE statements 
(CASSANDRA-17318)
 + * When streaming sees a ClosedChannelException this triggers the disk 
failure policy (CASSANDRA-17116)
 + * Add a virtual table for exposing prepared statements metrics 
(CASSANDRA-17224)
 + * Remove python 2.x support from cqlsh (CASSANDRA-17242)
 + * Prewarm role and credential caches to avoid timeouts at startup 
(CASSANDRA-16958)
 + * Make capacity/validity/updateinterval/activeupdate for Auth Caches 
configurable via nodetool (CASSANDRA-17063)
 + * Added startup check for read_ahead_kb setting (CASSANDRA-16436)
 + * Avoid unecessary array allocations and initializations when performing 
query checks (CASSANDRA-17209)
 + * Add guardrail for list operations that require read before write 
(CASSANDRA-17154)
 + * Migrate thresholds for number of keyspaces and tables to guardrails 
(CASSANDRA-17195)
 + * Remove self-reference in SSTableTidier (CASSANDRA-17205)
 + * Add guardrail for query page size (CASSANDRA-17189)
 + * Allow column_index_size_in_kb to be configurable through nodetool 
(CASSANDRA-17121)
 + * Emit a metric for number of local read and write calls
 + * Add non-blocking mode for CDC writes (CASSANDRA-17001)
 + * Add guardrails framework (CASSANDRA-17147)
 + * Harden resource management on SSTable components to prevent future leaks 
(CASSANDRA-17174)
 + * Make nodes more resilient to local unrelated files during startup 
(CASSANDRA-17082)
 + * repair prepare message would produce a wrong error message if network 
timeout happened rather than reply wait timeout (CASSANDRA-16992)
 + * Log queries that fail on timeout or unavailable errors up to once per 
minute by default (CASSANDRA-17159)
 + * Refactor normal/preview/IR repair to standardize repair cleanup and error 
handling of failed RepairJobs (CASSANDRA-17069)
 + * Log missing peers in StartupClusterConnectivityChecker (CASSANDRA-17130)
 + * Introduce separate rate limiting settings for entire SSTable streaming 
(CASSANDRA-17065)
 + * Implement Virtual Tables for Auth Caches (CASSANDRA-16914)
 + * Actively update auth cache in the background (CASSANDRA-16957)
 + * Add unix time conversion functions (CASSANDRA-17029)
 + * JVMStabilityInspector.forceHeapSpaceOomMaybe should handle all non-heap 
OOMs rather than only supporting direct only (CASSANDRA-17128)
 + * Forbid other Future implementations with checkstyle (CASSANDRA-17055)
 + * commit log was switched from non-daemon to daemon threads, which causes 
the JVM to exit in some case as no non-daemon threads are active 
(CASSANDRA-17085)
 + * Add a Denylist to block reads and writes on specific partition keys 
(CASSANDRA-12106)
 + * v4+ protocol did not clean up client warnings, which caused leaking the 
state (CASSANDRA-17054)
 + * Remove duplicate toCQLString in ReadCommand (CASSANDRA-17023)
 + * Ensure hint window is persistent across restarts of a node 
(CASSANDRA-14309)
 + * Allow to GRANT or REVOKE multiple permissions in a single statement 
(CASSANDRA-17030)
 + * Allow to grant permission for all tables in a keyspace (CASSANDRA-17027)
 + * Log time spent writing keys during compaction (CASSANDRA-17037)
 + * Make nodetool compactionstats and sstable_tasks consistent 
(CASSANDRA-16976)
 + * Add metrics and logging around index summary redistribution 
(CASSANDRA-17036)
 + * Add configuration options for minimum allowable replication factor and 
default replication factor (CASSANDRA-14557)
 + * Expose information about stored hints via a nodetool command and a virtual

[cassandra] branch cassandra-4.0 updated: Improve start up processing of Incremental Repair information read from system.repairs

2022-02-11 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

marcuse 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 c60ad61  Improve start up processing of Incremental Repair information 
read from system.repairs
c60ad61 is described below

commit c60ad61b3b6145af100578f2c652819f61729018
Author: Paul Chandler 
AuthorDate: Thu Feb 3 09:15:02 2022 +

Improve start up processing of Incremental Repair information read from 
system.repairs

Patch by Paul Chandler, reviewed by Brandon Williams and Marcus Eriksson 
for CASSANDRA-17342
---
 CHANGES.txt|   2 +-
 .../cassandra/repair/consistent/LocalSessions.java |  29 +++-
 .../cassandra/repair/consistent/RepairedState.java |  33 +
 .../repair/consistent/BulkRepairStateTest.java | 162 +
 4 files changed, 192 insertions(+), 34 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index de4876f..d41d293 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 4.0.3
-
+ * Improve start up processing of Incremental Repair information read from 
system.repairs (CASSANDRA-17342)
 
 4.0.2
  * Full Java 11 support (CASSANDRA-16894)
diff --git a/src/java/org/apache/cassandra/repair/consistent/LocalSessions.java 
b/src/java/org/apache/cassandra/repair/consistent/LocalSessions.java
index e6ca3ee..9ee0bb0 100644
--- a/src/java/org/apache/cassandra/repair/consistent/LocalSessions.java
+++ b/src/java/org/apache/cassandra/repair/consistent/LocalSessions.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
 import java.time.Instant;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -212,12 +213,7 @@ public class LocalSessions
 
 private void maybeUpdateRepairedState(LocalSession session)
 {
-if (session.getState() != FINALIZED)
-return;
-
-// if the session is finalized but has repairedAt set to 0, it was
-// a forced repair, and we shouldn't update the repaired state
-if (session.repairedAt == ActiveRepairService.UNREPAIRED_SSTABLE)
+if (!shouldStoreSession(session))
 return;
 
 for (TableId tid : session.tableIds)
@@ -227,6 +223,16 @@ public class LocalSessions
 }
 }
 
+private boolean shouldStoreSession(LocalSession session)
+{
+if (session.getState() != FINALIZED)
+return false;
+
+// if the session is finalized but has repairedAt set to 0, it was
+// a forced repair, and we shouldn't update the repaired state
+return session.repairedAt != ActiveRepairService.UNREPAIRED_SSTABLE;
+}
+
 /**
  * Determine if all ranges and tables covered by this session
  * have since been re-repaired by a more recent session
@@ -341,13 +347,19 @@ public class LocalSessions
 Preconditions.checkArgument(sessions.isEmpty(), "No sessions should be 
added before start");
 UntypedResultSet rows = 
QueryProcessor.executeInternalWithPaging(String.format("SELECT * FROM %s.%s", 
keyspace, table), 1000);
 Map loadedSessions = new HashMap<>();
+Map> initialLevels = new 
HashMap<>();
 for (UntypedResultSet.Row row : rows)
 {
 try
 {
 LocalSession session = load(row);
-maybeUpdateRepairedState(session);
 loadedSessions.put(session.sessionID, session);
+if (shouldStoreSession(session))
+{
+for (TableId tid : session.tableIds)
+initialLevels.computeIfAbsent(tid, (t) -> new 
ArrayList<>())
+ .add(new 
RepairedState.Level(session.ranges, session.repairedAt));
+}
 }
 catch (IllegalArgumentException | NullPointerException e)
 {
@@ -356,6 +368,9 @@ public class LocalSessions
 deleteRow(row.getUUID("parent_id"));
 }
 }
+for (Map.Entry> entry : 
initialLevels.entrySet())
+getRepairedState(entry.getKey()).addAll(entry.getValue());
+
 sessions = ImmutableMap.copyOf(loadedSessions);
 failOngoingRepairs();
 started = true;
diff --git a/src/java/org/apache/cassandra/repair/consistent/RepairedState.java 
b/src/java/org/apache/cassandra/repair/consistent/RepairedState.java
index ac0e7cb..ea60eec 100644
--- a/src/java/org/apache/cassandra/repair/consistent/RepairedState.java
+++ b/src/java/org/apache/cassandra/repair/consistent/RepairedState.java
@@ -23,22 +23,16 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
-i

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

2022-02-07 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 66d792adda3cca9b82d25bff3921a28957853d16
Merge: 371add4 b022aec
Author: Marcus Eriksson 
AuthorDate: Mon Feb 7 13:00:38 2022 +0100

Merge branch 'cassandra-3.11' into cassandra-4.0

 src/java/org/apache/cassandra/config/Config.java  | 13 +
 .../apache/cassandra/config/DatabaseDescriptor.java   | 16 
 .../apache/cassandra/cql3/functions/UDFunction.java   | 19 ++-
 .../security/ThreadAwareSecurityManager.java  |  5 +
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --cc src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java
index 86c8b5b,3d72559..3ff6820
--- a/src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java
+++ b/src/java/org/apache/cassandra/security/ThreadAwareSecurityManager.java
@@@ -66,13 -66,8 +67,14 @@@ public final class ThreadAwareSecurityM
  private static final RuntimePermission CHECK_MEMBER_ACCESS_PERMISSION = 
new RuntimePermission("accessDeclaredMembers");
  private static final RuntimePermission MODIFY_THREAD_PERMISSION = new 
RuntimePermission("modifyThread");
  private static final RuntimePermission MODIFY_THREADGROUP_PERMISSION = 
new RuntimePermission("modifyThreadGroup");
+ private static final RuntimePermission SET_SECURITY_MANAGER_PERMISSION = 
new RuntimePermission("setSecurityManager");
  
 +// Nashorn / Java 11
 +private static final RuntimePermission NASHORN_GLOBAL_PERMISSION = new 
RuntimePermission("nashorn.createGlobal");
 +private static final ReflectPermission SUPPRESS_ACCESS_CHECKS_PERMISSION 
= new ReflectPermission("suppressAccessChecks");
 +private static final RuntimePermission DYNALINK_LOOKUP_PERMISSION = new 
RuntimePermission("dynalink.getLookup");
 +private static final RuntimePermission GET_CLASSLOADER_PERMISSION = new 
RuntimePermission("getClassLoader");
 +
  private static volatile boolean installed;
  
  public static void install()

-
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 (5d0aeb1 -> b022aec)

2022-02-07 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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


from 5d0aeb1  Merge branch 'cassandra-3.0' into cassandra-3.11
 new 5c9ba06  Extend operator control over the UDF threading model
 new b022aec  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:
 src/java/org/apache/cassandra/config/Config.java  | 13 +
 .../apache/cassandra/config/DatabaseDescriptor.java   | 16 
 .../apache/cassandra/cql3/functions/UDFunction.java   | 19 ++-
 .../security/ThreadAwareSecurityManager.java  |  5 +
 4 files changed, 52 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

2022-02-07 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit 210793f943dc522161fd26b6192f38a5c83fa131
Merge: e256b98 66d792a
Author: Marcus Eriksson 
AuthorDate: Mon Feb 7 13:00:57 2022 +0100

Merge branch 'cassandra-4.0' into trunk

 src/java/org/apache/cassandra/config/Config.java  | 13 +
 .../apache/cassandra/config/DatabaseDescriptor.java   | 16 
 .../apache/cassandra/cql3/functions/UDFunction.java   | 19 ++-
 .../security/ThreadAwareSecurityManager.java  |  5 +
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --cc src/java/org/apache/cassandra/config/Config.java
index d3e6783,80c8435..1d01581
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@@ -497,17 -396,26 +497,30 @@@ public class Confi
   * "tell" a user that there's something really wrong with the UDF.
   * When you disable async UDF execution, users MUST pay attention to 
read-timeouts since these may indicate
   * UDFs that run too long or forever - and this can destabilize the 
cluster.
+  *
+  * This requires allow_insecure_udfs to be true
   */
 -public boolean enable_user_defined_functions_threads = true;
 +// Below parameter is not presented in cassandra.yaml but to be on the 
safe side that no one was directly using it
 +// I still added backward compatibility (CASSANDRA-15234)
 +@Replaces(oldName = "enable_user_defined_functions_threads", converter = 
Converters.IDENTITY, deprecated = true)
 +public boolean user_defined_functions_threads_enabled = true;
+ 
+ /**
+  * Set this to true to allow running insecure UDFs.
+  */
+ public boolean allow_insecure_udfs = false;
+ 
+ /**
+  * Set this to allow UDFs accessing java.lang.System.* methods, which 
basically allows UDFs to execute any arbitrary code on the system.
+  */
+ public boolean allow_extra_insecure_udfs = false;
+ 
  /**
   * Time in milliseconds after a warning will be emitted to the log and to 
the client that a UDF runs too long.
 - * (Only valid, if enable_user_defined_functions_threads==true)
 + * (Only valid, if user_defined_functions_threads_enabled==true)
   */
 -public long user_defined_function_warn_timeout = 500;
 +//No need of unit conversion as this parameter is not exposed in the yaml 
file
 +public long user_defined_function_warn_timeout_in_ms = 500;
  /**
   * Time in milliseconds after a fatal UDF run-time situation is detected 
and action according to
   * user_function_timeout_policy will take place.
diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 59cc169,6958422..cfa3945
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -724,33 -739,39 +724,39 @@@ public class DatabaseDescripto
  }
  
  // if set to empty/"auto" then use 5% of Heap size
 -indexSummaryCapacityInMB = (conf.index_summary_capacity_in_mb == null)
 +indexSummaryCapacityInMiB = (conf.index_summary_capacity == null)
 ? Math.max(1, (int) 
(Runtime.getRuntime().totalMemory() * 0.05 / 1024 / 1024))
 -   : conf.index_summary_capacity_in_mb;
 +   : 
conf.index_summary_capacity.toMebibytes();
  
 -if (indexSummaryCapacityInMB < 0)
 -throw new ConfigurationException("index_summary_capacity_in_mb 
option was set incorrectly to '"
 - + 
conf.index_summary_capacity_in_mb + "', it should be a non-negative integer.", 
false);
 +if (indexSummaryCapacityInMiB < 0)
 +throw new ConfigurationException("index_summary_capacity option 
was set incorrectly to '"
 + + 
conf.index_summary_capacity.toString() + "', it should be a non-negative 
integer.", false);
  
 -if (conf.user_defined_function_fail_timeout < 0)
 -throw new 
ConfigurationException("user_defined_function_fail_timeout must not be 
negative", false);
 -if (conf.user_defined_function_warn_timeout < 0)
 -throw new 
ConfigurationException("user_defined_function_warn_timeout must not be 
negative", false);
 +if (conf.user_defined_function_fail_timeout_in_ms < 0)
 +throw new 
ConfigurationException("user_defined_function_fail_timeout_in_ms must not be 
negative", false);
 +if (conf.user_defined_function_warn_timeout_in_ms < 0)
 +throw new 
ConfigurationException("user_defined_function_warn_timeout_in_ms must not

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

2022-02-07 Thread marcuse
This is an automated email from the ASF dual-hosted git repository.

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

commit b022aecfa665c021db4fb39267a7cf83f97ec135
Merge: 5d0aeb1 5c9ba06
Author: Marcus Eriksson 
AuthorDate: Mon Feb 7 12:59:52 2022 +0100

Merge branch 'cassandra-3.0' into cassandra-3.11

 src/java/org/apache/cassandra/config/Config.java  | 13 +
 .../apache/cassandra/config/DatabaseDescriptor.java   | 16 
 .../apache/cassandra/cql3/functions/UDFunction.java   | 19 ++-
 .../security/ThreadAwareSecurityManager.java  |  5 +
 4 files changed, 52 insertions(+), 1 deletion(-)

diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index a5a02ce,ca946ce..d64d054
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@@ -704,227 -737,6 +704,233 @@@ public class DatabaseDescripto
  
  conf.server_encryption_options.validate();
  
 +if (conf.user_defined_function_fail_timeout < 0)
 +throw new 
ConfigurationException("user_defined_function_fail_timeout must not be 
negative", false);
 +if (conf.user_defined_function_warn_timeout < 0)
 +throw new 
ConfigurationException("user_defined_function_warn_timeout must not be 
negative", false);
 +
 +if (conf.user_defined_function_fail_timeout < 
conf.user_defined_function_warn_timeout)
 +throw new 
ConfigurationException("user_defined_function_warn_timeout must less than 
user_defined_function_fail_timeout", false);
 +
++if (!conf.allow_insecure_udfs && 
!conf.enable_user_defined_functions_threads)
++throw new ConfigurationException("To be able to set 
enable_user_defined_functions_threads: false you need to set 
allow_insecure_udfs: true - this is an unsafe configuration and is not 
recommended.");
++
++if (conf.allow_extra_insecure_udfs)
++logger.warn("Allowing java.lang.System.* access in UDFs is 
dangerous and not recommended. Set allow_extra_insecure_udfs: false to 
disable.");
++
 +if (conf.commitlog_segment_size_in_mb <= 0)
 +throw new ConfigurationException("commitlog_segment_size_in_mb 
must be positive, but was "
 ++ conf.commitlog_segment_size_in_mb, false);
 +else if (conf.commitlog_segment_size_in_mb >= 2048)
 +throw new ConfigurationException("commitlog_segment_size_in_mb 
must be smaller than 2048, but was "
 ++ conf.commitlog_segment_size_in_mb, false);
 +
 +if (conf.max_mutation_size_in_kb == null)
 +conf.max_mutation_size_in_kb = conf.commitlog_segment_size_in_mb 
* 1024 / 2;
 +else if (conf.commitlog_segment_size_in_mb * 1024 < 2 * 
conf.max_mutation_size_in_kb)
 +throw new ConfigurationException("commitlog_segment_size_in_mb 
must be at least twice the size of max_mutation_size_in_kb / 1024", false);
 +
 +// native transport encryption options
 +if (conf.native_transport_port_ssl != null
 +&& conf.native_transport_port_ssl != conf.native_transport_port
 +&& !conf.client_encryption_options.enabled)
 +{
 +throw new ConfigurationException("Encryption must be enabled in 
client_encryption_options for native_transport_port_ssl", false);
 +}
 +
 +// If max protocol version has been set, just validate it's within an 
acceptable range
 +if (conf.native_transport_max_negotiable_protocol_version != 
Integer.MIN_VALUE)
 +{
 +try
 +{
 +
ProtocolVersion.decode(conf.native_transport_max_negotiable_protocol_version, 
ProtocolVersionLimit.SERVER_DEFAULT);
 +logger.info("Native transport max negotiable version 
statically limited to {}", 
conf.native_transport_max_negotiable_protocol_version);
 +}
 +catch (Exception e)
 +{
 +throw new ConfigurationException("Invalid setting for 
native_transport_max_negotiable_protocol_version; " +
 + 
ProtocolVersion.invalidVersionMessage(conf.native_transport_max_negotiable_protocol_version));
 +}
 +}
 +
 +if (conf.max_value_size_in_mb <= 0)
 +throw new ConfigurationException("max_value_size_in_mb must be 
positive", false);
 +else if (conf.max_value_size_in_mb >= 2048)
 +throw new ConfigurationException("max_value_size_in_mb must be 
smaller than 2048, but was "
 ++ conf.max_value_size_in_mb, false);
 +
 +switch (conf.disk_optimization_strategy)
 +{
 +

  1   2   3   4   5   6   7   8   9   10   >