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


##########
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:
   so turns out this is basically a test bug
   
   we use SAIUtils to see if its safe to use the index, but this only checks 
`node1`.
   
   `node2` and `node3` *learn* about each other's status via gossip
   
   this puts us in a race where you run a query on node2/3 and they have yet to 
see the status updated on the peers
   
   I pushed a fix so the utils checks every node



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