dcapwell commented on code in PR #4081:
URL: https://github.com/apache/cassandra/pull/4081#discussion_r2043230715


##########
test/distributed/org/apache/cassandra/distributed/test/cql3/StatefulASTBase.java:
##########
@@ -496,11 +499,43 @@ protected ByteBuffer[][] executeQuery(IInstance instance, 
int fetchSize, Consist
                                  .findAny()
                                  .get();
                 ss.setHost(host);
-                ResultSet result = session.execute(ss);
+                // Only SELECT is known safe to retry, as Mutations might not 
be idempotent!
+                boolean allowRetries = stmt.kind() == Statement.Kind.SELECT;
+                ResultSet result = !allowRetries ? session.execute(ss)
+                                                 : executeWithRetries(ss, 3);
                 return getRowsAsByteBuffer(result);
             }
         }
 
+        private ResultSet executeWithRetries(SimpleStatement ss, int maxTries)
+        {
+            Backoff backoff = null;
+            Throwable lastError = null;
+            for (int i = 0; i < maxTries; i++)
+            {
+                try
+                {
+                    return session.execute(ss);
+                }
+                catch (Throwable t)

Review Comment:
   switched to `ReadFailureException` and enriched the error to show what peer 
failed and why



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to