dcapwell commented on code in PR #2844:
URL: https://github.com/apache/cassandra/pull/2844#discussion_r1372139477
##########
src/java/org/apache/cassandra/repair/messages/RepairMessage.java:
##########
@@ -67,11 +86,36 @@ private enum ErrorHandling { NONE, TIMEOUT, RETRY }
map.put(Verb.SYNC_REQ, timeoutVersion);
map.put(Verb.VALIDATION_RSP, SUPPORTS_RETRY);
map.put(Verb.SYNC_RSP, SUPPORTS_RETRY);
+ // IR messages
+ map.put(Verb.PREPARE_CONSISTENT_REQ, SUPPORTS_RETRY);
+ map.put(Verb.PREPARE_CONSISTENT_RSP, SUPPORTS_RETRY);
+ map.put(Verb.FINALIZE_PROPOSE_MSG, SUPPORTS_RETRY);
+ map.put(Verb.FINALIZE_PROMISE_MSG, SUPPORTS_RETRY);
+ map.put(Verb.FINALIZE_COMMIT_MSG, SUPPORTS_RETRY);
+ map.put(Verb.FAILED_SESSION_MSG, SUPPORTS_RETRY);
VERB_TIMEOUT_VERSIONS = Collections.unmodifiableMap(map);
+
+ EnumSet<Verb> allowsRetry = EnumSet.noneOf(Verb.class);
+ allowsRetry.add(Verb.PREPARE_MSG);
+ allowsRetry.add(Verb.VALIDATION_REQ);
+ allowsRetry.add(Verb.VALIDATION_RSP);
+ allowsRetry.add(Verb.SYNC_REQ);
+ allowsRetry.add(Verb.SYNC_RSP);
+ allowsRetry.add(Verb.SNAPSHOT_MSG);
+ allowsRetry.add(Verb.CLEANUP_MSG);
+ // IR messages
+ allowsRetry.add(Verb.PREPARE_CONSISTENT_REQ);
+ allowsRetry.add(Verb.PREPARE_CONSISTENT_RSP);
+ allowsRetry.add(Verb.FINALIZE_PROPOSE_MSG);
+ allowsRetry.add(Verb.FINALIZE_PROMISE_MSG);
+ allowsRetry.add(Verb.FINALIZE_COMMIT_MSG);
+ allowsRetry.add(Verb.FAILED_SESSION_MSG);
+ ALLOWS_RETRY = Collections.unmodifiableSet(allowsRetry);
}
- private static final Set<Verb> SUPPORTS_RETRY_WITHOUT_VERSION_CHECK =
Collections.unmodifiableSet(EnumSet.of(Verb.CLEANUP_MSG));
private static final Logger logger =
LoggerFactory.getLogger(RepairMessage.class);
+ private static final NoSpamLogger noSpam = NoSpamLogger.getLogger(logger,
1, TimeUnit.MINUTES);
Review Comment:
from https://issues.apache.org/jira/browse/CASSANDRA-18952
##########
src/java/org/apache/cassandra/repair/messages/RepairMessage.java:
##########
@@ -121,27 +165,25 @@ public static <T> void
sendMessageWithRetries(SharedContext ctx, RepairMessage r
public static void sendMessageWithRetries(SharedContext ctx, RepairMessage
request, Verb verb, InetAddressAndPort endpoint)
{
- sendMessageWithRetries(ctx, backoff(ctx, verb), always(), request,
verb, endpoint, new RequestCallback<>()
- {
- @Override
- public void onResponse(Message<Object> msg)
- {
- }
+ sendMessageWithRetries(ctx, backoff(ctx, verb), always(), request,
verb, endpoint, NOOP_CALLBACK, 0);
+ }
- @Override
- public void onFailure(InetAddressAndPort from,
RequestFailureReason failureReason)
- {
- }
- }, 0);
+ public static void sendMessageWithRetries(SharedContext ctx,
Supplier<Boolean> allowRetry, RepairMessage request, Verb verb,
InetAddressAndPort endpoint)
+ {
+ sendMessageWithRetries(ctx, backoff(ctx, verb), allowRetry, request,
verb, endpoint, NOOP_CALLBACK, 0);
}
- private static <T> void sendMessageWithRetries(SharedContext ctx, Backoff
backoff, Supplier<Boolean> allowRetry, RepairMessage request, Verb verb,
InetAddressAndPort endpoint, RequestCallback<T> finalCallback, int attempt)
+ @VisibleForTesting
+ static <T> void sendMessageWithRetries(SharedContext ctx, Backoff backoff,
Supplier<Boolean> allowRetry, RepairMessage request, Verb verb,
InetAddressAndPort endpoint, RequestCallback<T> finalCallback, int attempt)
{
+ if (!ALLOWS_RETRY.contains(verb))
Review Comment:
https://issues.apache.org/jira/browse/CASSANDRA-18952
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]