rpuch commented on code in PR #2761:
URL: https://github.com/apache/ignite-3/pull/2761#discussion_r1375805954


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -520,18 +518,84 @@ private CompletableFuture<HybridTimestamp> 
validateTableExistence(ReplicaRequest
         }
 
         return schemaSyncService.waitForMetadataCompleteness(opStartTs)
-                .thenApply(unused -> {
-                    schemaCompatValidator.failIfTableDoesNotExistAt(opStartTs, 
tableId());
+                .thenRun(() -> 
schemaCompatValidator.failIfTableDoesNotExistAt(opStartTs, tableId()));
+    }
+
+    /**
+     * Makes sure that {@link 
SchemaVersionAwareReplicaRequest#schemaVersion()} sent in a request matches 
table schema version
+     * corresponding to the operation.
+     *
+     * @param request Replica request corresponding to the operation.
+     * @param opTsIfDirectRo Operation timestamp for a direct RO, {@code null} 
otherwise.
+     * @return Future completed when the validation is finished.
+     */
+    private CompletableFuture<Void> validateSchemaMatch(ReplicaRequest 
request, @Nullable HybridTimestamp opTsIfDirectRo) {
+        if (!(request instanceof SchemaVersionAwareReplicaRequest)) {
+            return completedFuture(null);
+        }
+
+        SchemaVersionAwareReplicaRequest versionAwareRequest = 
(SchemaVersionAwareReplicaRequest) request;
+
+        HybridTimestamp tsToWaitForSchema = getTxStartTimestamp(request);

Review Comment:
   Well, `getTxStartTimestamp()` returns the timestamp corresponding to the 
start of a transaction. I'm not sure that we should stretch the direct RO 
operation timestamp to think about it as a transaction start ts.



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

Reply via email to