rpuch commented on code in PR #2055:
URL: https://github.com/apache/ignite-3/pull/2055#discussion_r1191265498
##########
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 -> {
Review Comment:
I return a future to signal an exception, so `thenAccept()` does not fit. Do
you suggest throwing the exception?
##########
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 -> {
Review Comment:
I return a future to signal an exception, so `thenAccept()` does not fit. Do
you suggest to throw 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]