denis-chudov commented on code in PR #7588:
URL: https://github.com/apache/ignite-3/pull/7588#discussion_r2847561998
##########
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroups.java:
##########
@@ -468,6 +468,9 @@ public static class Transactions {
/** Operation failed due to replication delayed ack failure. */
public static final int TX_DELAYED_ACK_ERR =
TX_ERR_GROUP.registerErrorCode((short) 17);
+
+ /** Transaction was internally killed. This is retriable state. */
Review Comment:
What means `retriable`? I don't see it in any "retriable errors" list.
Retriable for implicit txns?
##########
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:
what happens if client dies before sending discard message? afaik the server
coordinator doesn't have all partition mappings, who will release the locks?
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/ReadWriteTransactionImpl.java:
##########
@@ -239,6 +248,7 @@ private CompletableFuture<Void> finishInternal(
finishFuture = nullCompletedFuture();
this.timeoutExceeded = timeoutExceeded;
} else {
+ assert killClosure == null : "Invalid kill state for a
full transaction";
Review Comment:
We have a ticket about avoidance of usage of asserts
https://issues.apache.org/jira/browse/IGNITE-27139
Can it be replaced with 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]