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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1158,25 +1169,31 @@ private CompletableFuture<Object> 
finishTransaction(List<TablePartitionId> aggre
         HybridTimestamp currentTimestamp = hybridClock.now();
         HybridTimestamp commitTimestamp = commit ? currentTimestamp : null;
 
-        FinishTxCommandBuilder finishTxCmdBldr = MSG_FACTORY.finishTxCommand()
-                .txId(txId)
-                .commit(commit)
-                .safeTimeLong(currentTimestamp.longValue())
-                .tablePartitionIds(
-                        aggregatedGroupIds.stream()
-                                
.map(PartitionReplicaListener::tablePartitionId)
-                                .collect(toList())
-                );
-
-        if (commit) {
-            finishTxCmdBldr.commitTimestampLong(commitTimestamp.longValue());
-        }
+        return catalogVersionFor(currentTimestamp)
+                .thenApply(catalogVersion -> {
+                    FinishTxCommandBuilder finishTxCmdBldr = 
MSG_FACTORY.finishTxCommand()
+                            .txId(txId)
+                            .commit(commit)
+                            .safeTimeLong(currentTimestamp.longValue())
+                            .requiredCatalogVersion(catalogVersion)
+                            .tablePartitionIds(
+                                    aggregatedGroupIds.stream()
+                                            
.map(PartitionReplicaListener::tablePartitionId)
+                                            .collect(toList())
+                            );
+
+                    if (commit) {
+                        
finishTxCmdBldr.commitTimestampLong(commitTimestamp.longValue());

Review Comment:
   It matches the safeTime only for commits; for aborts it's null



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