This is an automated email from the ASF dual-hosted git repository.
samt 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 07885ef317 Make shadow gossip round parameters configurable for testing
07885ef317 is described below
commit 07885ef317e3dc748085f60e30c32c8709bcd585
Author: Sam Tunnicliffe <[email protected]>
AuthorDate: Mon Mar 16 17:56:00 2026 +0000
Make shadow gossip round parameters configurable for testing
Patch by Sam Tunnicliffe; reviewed by Marcus Eriksson for
CASSANDRA-21149
---
CHANGES.txt | 1 +
.../org/apache/cassandra/config/CassandraRelevantProperties.java | 2 ++
src/java/org/apache/cassandra/gms/NewGossiper.java | 7 +++++--
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index bb2cd1e6da..a61194e5ef 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
5.1
+ * Make shadow gossip round parameters configurable for testing
(CASSANDRA-21149)
* Avoid potential gossip thread deadlock during decommission (CASSANDRA-21143)
* Improve construction of consensus groups for range movements
(CASSANDRA-21142)
* Support compaction_read_disk_access_mode for cursor-based compaction
(CASSANDRA-21147)
diff --git
a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
index 05875726e3..1cf86a782c 100644
--- a/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
+++ b/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java
@@ -586,6 +586,8 @@ public enum CassandraRelevantProperties
// transactional cluster metadata relevant properties
// TODO: not a fan of being forced to prefix these to satisfy the
alphabetic ordering constraint
// but it makes sense to group logically related properties together
+ TCM_SHADOW_ROUND_MAX_ATTEMPTS("cassandra.shadow_round_max_attempts", "3"),
+ TCM_SHADOW_ROUND_TIMEOUT("cassandra.shadow_round_timeout_millis", "15000"),
/**
* for testing purposes disable the automatic CMS reconfiguration after a
bootstrap/replace/move operation
*/
diff --git a/src/java/org/apache/cassandra/gms/NewGossiper.java
b/src/java/org/apache/cassandra/gms/NewGossiper.java
index 4bb8b75968..073943fddc 100644
--- a/src/java/org/apache/cassandra/gms/NewGossiper.java
+++ b/src/java/org/apache/cassandra/gms/NewGossiper.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.apache.cassandra.config.CassandraRelevantProperties;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.SystemKeyspace;
import org.apache.cassandra.locator.InetAddressAndPort;
@@ -68,15 +69,17 @@ public class NewGossiper
handler = shadowRoundHandler;
int tries = 0;
+ int maxTries =
CassandraRelevantProperties.TCM_SHADOW_ROUND_MAX_ATTEMPTS.getInt();
+ long timeout =
CassandraRelevantProperties.TCM_SHADOW_ROUND_TIMEOUT.getLong();
while (true)
{
try
{
- return shadowRoundHandler.doShadowRound().get(15,
TimeUnit.SECONDS);
+ return shadowRoundHandler.doShadowRound().get(timeout,
TimeUnit.MILLISECONDS);
}
catch (InterruptedException | ExecutionException |
TimeoutException e)
{
- if (++tries > 3)
+ if (++tries >= maxTries)
break;
logger.warn("Got no response for shadow round");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]