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


##########
test/distributed/org/apache/cassandra/distributed/test/accord/AccordTestBase.java:
##########
@@ -373,21 +379,37 @@ private static SimpleQueryResult executeWithRetry0(int 
count, Cluster cluster, S
 
     public static SimpleQueryResult executeWithRetry(Cluster cluster, String 
check, Object... boundValues)
     {
-        check = wrapInTxn(check);
+        return executeWithRetry(cluster.get(1), check, boundValues);
+    }
 
+    public static SimpleQueryResult executeWithRetry(IInvokableInstance inst, 
String check, Object... boundValues)
+    {
         // is this method safe?
 
-        if (!isIdempotent(cluster, check))
+        if (!isIdempotent(inst, check))
             throw new AssertionError("Unable to retry txn that is not 
idempotent: cql=\n" + check);
 
-        return executeWithRetry0(0, cluster, check, boundValues);
+        return executeWithRetry0(0, inst, check, boundValues);
     }
 
-    private static boolean isIdempotent(Cluster cluster, String cql)
+    public static Boolean isIdempotent(IInvokableInstance inst, String cql)
     {
-        return cluster.get(1).callOnInstance(() -> {
-            TransactionStatement stmt = AccordTestUtils.parse(cql);
-            return isIdempotent(stmt);
+        return inst.callOnInstance(() -> {
+            CQLStatement.Raw parsed = QueryProcessor.parseStatement(cql);
+            if (parsed instanceof TransactionStatement.Parsed)
+            {
+                TransactionStatement stmt = (TransactionStatement) 
parsed.prepare(ClientState.forInternalCalls());
+                return isIdempotent(stmt);
+            }
+            else if (parsed instanceof ModificationStatement.Parsed)

Review Comment:
   CAS queries gets converted to Accord, so we still want to support...



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

Reply via email to