tkalkirill commented on code in PR #2910:
URL: https://github.com/apache/ignite-3/pull/2910#discussion_r1414854802
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -608,62 +612,70 @@ private CompletableFuture<Void>
validateSchemaMatch(ReplicaRequest request, @Nul
* {@link SchemaRegistry#schema(int)}.
*
* @param request Replica request corresponding to the operation.
- * @param opTsIfDirectRo Operation timestamp for a direct RO, {@code null}
otherwise.
+ * @param opTs Operation timestamp.
* @return Future completed when the validation is finished.
*/
- private CompletableFuture<Void> waitForSchemasBeforeReading(ReplicaRequest
request, @Nullable HybridTimestamp opTsIfDirectRo) {
- HybridTimestamp tsToWaitForSchema = getTxStartTimestamp(request);
- if (tsToWaitForSchema == null) {
- tsToWaitForSchema = opTsIfDirectRo;
- }
+ private CompletableFuture<Void> waitForSchemasBeforeReading(ReplicaRequest
request, HybridTimestamp opTs) {
+ HybridTimestamp tsToWaitForSchema = getTsToWaitForSchema(request,
opTs);
return tsToWaitForSchema == null ? nullCompletedFuture() :
schemaSyncService.waitForMetadataCompleteness(tsToWaitForSchema);
}
/**
- * Returns timestamp of transaction start (for RW/timestamped RO requests)
or @{code null} for other requests.
+ * Returns the timestamp for which the schema will need to be awaited.
+ *
+ * <ul>
+ * <li>For RW - begin timestamp of transaction.</li>
+ * <li>For RO - read timestamp.</li>
+ * <li>For RO direct - operation timestamp.</li>
+ * <li>For others, {@code null}.</li>
+ * </ul>
*
* @param request Replica request corresponding to the operation.
+ * @param opTs Operation timestamp.
*/
- private static @Nullable HybridTimestamp
getTxStartTimestamp(ReplicaRequest request) {
- HybridTimestamp txStartTimestamp;
+ private static @Nullable HybridTimestamp
getTsToWaitForSchema(ReplicaRequest request, HybridTimestamp opTs) {
+ HybridTimestamp tsToWaitForSchema;
Review Comment:
Why not
--
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]