Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,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
*/
Expand Down
7 changes: 5 additions & 2 deletions src/java/org/apache/cassandra/gms/NewGossiper.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
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;
Expand Down Expand Up @@ -68,15 +69,17 @@ public Map<InetAddressAndPort, EndpointState> doShadowRound()
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");
}
Expand Down