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


##########
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>
+     *     <li>For an RO read (with readTimestamp), it's readTimestamp 
(matches readTimestamp in the transaction)</li>
+     *     <li>For an RO direct read, it's the timestamp chosen (as 'now') to 
process the request</li>

Review Comment:
   Again, there are RW reads and RO reads which further split into RO reads 
with a timestamp and direct RO reads. Here, 'RO' seems to be important.



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