sanpwc commented on code in PR #2820:
URL: https://github.com/apache/ignite-3/pull/2820#discussion_r1389428714
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -1677,32 +1703,45 @@ private CompletableFuture<Void>
processTxCleanupAction(TxCleanupReplicaRequest r
return reliableCatalogVersionFor(commandTimestamp)
.thenCompose(catalogVersion -> {
- synchronized (commandProcessingLinearizationMutex) {
- TxCleanupCommand txCleanupCmd =
MSG_FACTORY.txCleanupCommand()
- .txId(request.txId())
- .commit(request.commit())
-
.commitTimestampLong(request.commitTimestampLong())
- .safeTimeLong(hybridClock.nowLong())
-
.txCoordinatorId(getTxCoordinatorId(request.txId()))
- .requiredCatalogVersion(catalogVersion)
- .build();
-
-
storageUpdateHandler.handleTransactionCleanup(request.txId(), request.commit(),
request.commitTimestamp());
-
- raftClient.run(txCleanupCmd)
- .exceptionally(e -> {
- LOG.warn("Failed to complete
transaction cleanup command [txId=" + request.txId() + ']', e);
-
- return completedFuture(null);
- });
- }
+ applyCleanupCommand(
+ request.txId(),
+ request.commit(),
+ request.commitTimestamp(),
+ request.commitTimestampLong(),
+ catalogVersion
+ );
return allOffFuturesExceptionIgnored(txReadFutures,
request)
.thenRun(() -> releaseTxLocks(request.txId()));
});
});
}
+ private CompletableFuture<Void> applyCleanupCommand(
+ UUID transactionId,
+ boolean commit,
+ HybridTimestamp commitTimestamp,
+ long commitTimestampLong,
+ int catalogVersion
+ ) {
+ TxCleanupCommand txCleanupCmd = MSG_FACTORY.txCleanupCommand()
+ .txId(transactionId)
+ .commit(commit)
+ .commitTimestampLong(commitTimestampLong)
+ .safeTimeLong(hybridClock.nowLong())
+ .txCoordinatorId(getTxCoordinatorId(transactionId))
+ .requiredCatalogVersion(catalogVersion)
+ .build();
+
+ storageUpdateHandler.handleTransactionCleanup(transactionId, commit,
commitTimestamp);
+
+ CompletableFuture<Object> resultFuture = new CompletableFuture<>();
+
+ applyCmdWithRetryOnSafeTimeReorderException(txCleanupCmd,
resultFuture);
+
+ return resultFuture.thenApply(res -> null);
Review Comment:
No, it's a bug. Fixed.
--
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]