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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -472,34 +472,30 @@ private CompletableFuture<?> 
processRequest(ReplicaRequest request, @Nullable Bo
             }
         }
 
-        return waitForSchemasBeforeReading(request)
-                .thenCompose(unused -> validateTableExistence(request))
-                .thenCompose(opStartTimestamp -> 
processOperationRequest(request, isPrimary, senderId, opStartTimestamp));
+        HybridTimestamp opTsIfDirectRo = (request instanceof 
ReadOnlyDirectReplicaRequest) ? hybridClock.now() : null;
+
+        return validateTableExistence(request, opTsIfDirectRo)
+                .thenCompose(unused -> validateSchemaMatch(request, 
opTsIfDirectRo))
+                .thenCompose(unused -> waitForSchemasBeforeReading(request, 
opTsIfDirectRo))
+                .thenCompose(opStartTimestamp -> 
processOperationRequest(request, isPrimary, senderId, opTsIfDirectRo));
     }
 
     /**
-     * Makes sure that we have schemas corresponding to the moment of tx 
start; this makes PK extraction safe WRT
-     * {@link org.apache.ignite.internal.schema.SchemaRegistry#schema(int)}.
+     * Validates that the table exists at a timestamp corresponding to the 
request operation.
      *
-     * @param request Request that's being processed.
+     * <ul>
+     *     <li>For an RW read/write, it's 'now'</li>

Review Comment:
   I rephrased a bit



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