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


##########
test/simulator/main/org/apache/cassandra/simulator/paxos/HistoryValidator.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.simulator.paxos;
+
+import javax.annotation.Nullable;
+
+public interface HistoryValidator
+{
+    Checker start(Observation observation);
+
+    void log(@Nullable Integer pk);
+
+    interface Checker extends AutoCloseable
+    {
+        void witnessRead(int pk, int count, int[] seq);
+        void witnessWrite(int pk);

Review Comment:
   They couldn't provide the wrong thing if you validate it?
   
   As it stands, it is unclear what it is we are logging as written, which 
wasn't the case before. It's implicit knowledge that it is the observation id 
we are writing, which is especially obtuse since the id exists whether or not 
we write. 
   
   I'd be inclined then to just have `LinearizabilityValidator` implement an 
API similar to the one provided by the StrictSerializabilityVerifier, and 
introduce a common interface that we call directly, as it was IMO clearer what 
was being reported (but not prescriptive - if you have a better idea by all 
means)



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