ascherbakoff commented on code in PR #7588:
URL: https://github.com/apache/ignite-3/pull/7588#discussion_r2851639262
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/TxCleanupRequestHandler.java:
##########
@@ -291,6 +291,36 @@ private void sendCleanupReplicatedResponse(UUID txId,
InternalClusterNode sender
messagingService.send(sender, ChannelType.DEFAULT, prepareResponse(new
CleanupReplicatedInfo(txId, partitions)));
}
+ /**
+ * Discards local write intents.
+ *
+ * @param partitions Partitions.
+ * @param txId The transaction id.
+ *
+ * @return The future.
+ */
+ CompletableFuture<Void>
discardLocalWriteIntents(List<EnlistedPartitionGroup> partitions, UUID txId) {
+ Map<EnlistedPartitionGroup, CompletableFuture<?>> writeIntentSwitches
= new HashMap<>();
+
+ for (EnlistedPartitionGroup partition : partitions) {
+ CompletableFuture<Void> future =
writeIntentSwitchProcessor.switchLocalWriteIntents(
+ partition,
+ txId,
+ false,
+ null
+ ).thenAccept(this::processWriteIntentSwitchResponse);
+
+ writeIntentSwitches.put(partition, future);
+ }
+
+ releaseTxLocks(txId);
Review Comment:
Currently locks will be cleaned up on tx timeout, which is not the best
solution.
There is a ticket for improvement [1]
[1] https://issues.apache.org/jira/browse/IGNITE-27651
--
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]