lordgarrish commented on code in PR #13339:
URL: https://github.com/apache/ignite/pull/13339#discussion_r3944373684


##########
docs/_docs/key-value-api/transactions.adoc:
##########
@@ -322,6 +341,89 @@ A transaction might fail with the following exceptions:
 
 
 == Long Running Transactions Termination
+The `tx` command of the `control.sh` utility allows you to search for 
transactions based on various criteria (such as ID, duration, or label) and 
roll back transactions. Since transactions in Apache Ignite are generally 
distributed (multiple nodes are involved in processing a single transaction), 
this command may display the same transaction as present on multiple nodes 
simultaneously.
+
+Rolling back a transaction using the `tx` command is only possible for the 
`ACTIVE`, `PREPARING`, and `PREPARED` statuses. A transaction in statuses 
related to the `rollback` procedure is already in the process of rolling back. 
Transactions in the `COMMITTING` and `COMMITTED` statuses cannot be rolled back 
due to 2PC protocol restrictions.
+
+* First termination stage — cancelling transactions using `tx kill`. To cancel 
transactions, use the `control.sh` utility to minimize the impact on the 
cluster:
+. Execute the `control.sh --tx --min-duration <transaction_timeout_in_ms>` 
command in the cluster. Example output:
++
+----
+Command [TX] started
+Arguments: --tx --min-duration 30
+--------------------------------------------------------------------------------
+Matching transactions:
+TcpDiscoveryNode [id=<id>, addrs=[<address>], order=1, 
ver=2.18.0#YYYYMMDD-sha1:00000000, isClient=false, 
consistentId=gridCommandHandlerTest0]
+    Tx: [xid=<id>, label=null, state=ACTIVE, startTime=YYYY-MM-DD 
15:15:16.852, duration=3 sec, isolation=REPEATABLE_READ, 
concurrency=PESSIMISTIC, topVer=AffinityTopologyVersion [topVer=3, 
minorTopVer=2], timeout=0 sec, size=100, dhtNodes=[<id>, <id>], nearXid=<id>, 
parentNodeIds=[<id>]]
+    Tx: [xid=<id>, label=null, state=ACTIVE, startTime=YYYY-MM-DD 
15:15:16.852, duration=3 sec, isolation=REPEATABLE_READ, 
concurrency=PESSIMISTIC, topVer=AffinityTopologyVersion [topVer=3, 
minorTopVer=2], timeout=0 sec, size=100, dhtNodes=[<id>, <id>], nearXid=<id>, 
parentNodeIds=[<id>]]
+Command [TX] finished with code: 0
+----
+. Extract the `xid` from all transactions across all nodes and remove 
duplicate `xid` values. Duplicates occur because the same transaction can exist 
on multiple nodes — in this case, its `xid` will appear in the command output 
multiple times.
+. For each `xid`, run the `tx kill` command to roll back that transaction. 
Example call: `control.sh --tx --xid <id> --kill`.

Review Comment:
   You're right, it looks redundant. Thanks :)



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