ibessonov commented on code in PR #2450:
URL: https://github.com/apache/ignite-3/pull/2450#discussion_r1302659227
##########
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:
Ok, so it matches safeTime every time we read it. Looks like an excessive
data to me :) We should get rid of it in the future I think
--
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]