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


##########
test/simulator/main/org/apache/cassandra/simulator/paxos/PairOfSequencesAccordSimulation.java:
##########
@@ -281,21 +211,151 @@ protected String preInsertStmt()
     }
 
     @Override
-    Operation verifying(int operationId, IInvokableInstance instance, int 
primaryKey, HistoryChecker historyChecker)
+    boolean allowMultiplePartitions() { return true; }
+
+    @Override
+    BiFunction<SimulatedSystems, int[], Supplier<Action>> actionFactory()
     {
-        return new VerifyingOperation(operationId, instance, 
serialConsistency, primaryKey, historyChecker);
+        AtomicInteger id = new AtomicInteger(0);
+
+        return (simulated, primaryKeyIndex) -> {
+            int[] partitions = IntStream.of(primaryKeyIndex).map(i -> 
primaryKeys[i]).toArray();
+            return () -> accordAction(id.getAndIncrement(), simulated, 
partitions);
+        };
     }
 
-    @Override
-    Operation nonVerifying(int operationId, IInvokableInstance instance, int 
primaryKey, HistoryChecker historyChecker)
+    private static IIsolatedExecutor.SerializableCallable<SimpleQueryResult> 
query(int id, int[] partitions, int[] readOnly)
     {
-        return new NonVerifyingOperation(operationId, instance, 
serialConsistency, primaryKey, historyChecker);
+        return () -> execute(createAccordTxn(id, partitions, readOnly), "pk", 
"count", "seq");
     }
 
-    @Override
-    Operation modifying(int operationId, IInvokableInstance instance, int 
primaryKey, HistoryChecker historyChecker)
+    public class ReadWriteOperation extends Operation
     {
-        return new ModifyingOperation(operationId, instance, ANY, 
serialConsistency, primaryKey, historyChecker);
+        private final IntSet allPartitions;
+        private final IntSet readOnlySet;

Review Comment:
   > Well, the list append can be truly blind (and should be), so we’re testing 
additional functionality. If it isn’t today, that’s something we should address 
(it is for Paxos, and we shouldn’t regress).
   
   Makes sense, we can't do for `String` but *should* be able to do for `list`, 
so could leverage that.
   
   > We shouldn’t also witness any reads performed internally, and if we do 
that’s also a bug 
   
   Its an internal detail, normal CQL is unable to do this.  If you work at the 
`Txn` level you see the reads, if you work at the CQL level you only see what 
you asked for.
   
   > I’m not sure what you mean about false violations but the verifier 
supports blind writes just fine?
   
   its more if you are working with a type that requires read to update, then 
to avoid a read you need to ignore the history; simple example
   
   ```
   create table foo (pk int PRIMARY KEY, seq text)
   
   txn(INSERT INTO foo(pk, seq) VALUES (?, "lacking history...")
   ```



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