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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -976,13 +983,34 @@ private CompletableFuture<Void> 
processTxFinishAction(TxFinishReplicaRequest req
         List<TablePartitionId> aggregatedGroupIds = 
request.groups().values().stream()
                 .flatMap(List::stream)
                 .map(IgniteBiTuple::get1)
-                .collect(Collectors.toList());
+                .collect(toList());
 
         UUID txId = request.txId();
 
-        boolean commit = request.commit();
+        return schemaCompatValidator.validateForwards(txId, 
aggregatedGroupIds, request.commit(), request.commitTimestamp())
+                .thenCompose(validationResult -> {
+                    boolean stillCommit = request.commit() && 
validationResult.isOk();
 
-        CompletableFuture<Object> changeStateFuture = 
finishTransaction(aggregatedGroupIds, txId, commit);
+                    return finishAndCleanup(request, stillCommit, 
aggregatedGroupIds, txId)
+                            .thenCompose(result -> {
+                                if (validationResult.isOk()) {
+                                    return completedFuture(result);
+                                } else {
+                                    return failedFuture(new 
AbortDueToIncompatibleSchemaException("Commit failed because schema "

Review Comment:
   The idea is that, if validation fails, we change the intention from commit 
to abort, so finishTransaction() will actually abort the transaction, and only 
then will we signal the exception



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