You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "Lalant (via GitHub)" <gi...@apache.org> on 2025/12/24 13:14:03 UTC

[PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Lalant opened a new pull request, #7304:
URL: https://github.com/apache/ignite-3/pull/7304

   …bel.
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2731333243


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -866,15 +858,24 @@ private boolean isWaiterReadyToNotify(WaiterImpl waiter, boolean skipFail) {
 
                 if (currentlyAcquiredLockMode != null && !currentlyAcquiredLockMode.isCompatible(intendedLockMode)) {
                     if (conflictFound(waiter.txId())) {
-                        waiter.fail(abandonedLockException(waiter.txId, tmp.txId));
+                        waiter.fail(new PossibleDeadlockOnLockAcquireException(

Review Comment:
   Done



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -892,15 +893,23 @@ private boolean isWaiterReadyToNotify(WaiterImpl waiter, boolean skipFail) {
                     if (skipFail) {
                         return false;
                     } else if (conflictFound(waiter.txId())) {
-                        waiter.fail(abandonedLockException(waiter.txId, tmp.txId));
-
+                        waiter.fail(new PossibleDeadlockOnLockAcquireException(
+                                waiter.txId,
+                                tmp.txId,
+                                intendedLockMode,
+                                currentlyAcquiredLockMode,
+                                true,

Review Comment:
   Done



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2681159970


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -152,7 +153,7 @@ private CompletableFuture<?> callCleanup(TxMeta txMeta, UUID txId) {
                 txMeta.commitTimestamp(),
                 txId
         ).exceptionally(throwable -> {
-            LOG.warn("Failed to cleanup transaction [txId={}].", throwable, txId);
+            LOG.warn("Failed to cleanup transaction [{}].", throwable, TransactionLogUtils.formatTxInfo(txId, txManager));

Review Comment:
   Done



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2731338915


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/PossibleDeadlockOnLockAcquireException.java:
##########
@@ -32,18 +34,25 @@ public class PossibleDeadlockOnLockAcquireException extends LockException {
      * @param currentLockHolderTxId UUID of a transaction that currently holds the lock.
      * @param attemptedLockModeToAcquireWith {@link LockMode} that was tried to acquire the lock with but failed the attempt.
      * @param currentlyAcquiredLockMode {@link LockMode} of the lock that is already acquired with.
+     * @param abandonedLock flag which shows the status of the lock. If the state is uncertain, it's treated as abandoned.
+     * @param txStateMetaStorage txState required to properly log tx labels.
      */
     public PossibleDeadlockOnLockAcquireException(
             UUID failedToAcquireLockTxId,
             UUID currentLockHolderTxId,
             LockMode attemptedLockModeToAcquireWith,
-            LockMode currentlyAcquiredLockMode
+            LockMode currentlyAcquiredLockMode,
+            boolean abandonedLock,
+            VolatileTxStateMetaStorage txStateMetaStorage
     ) {
         super(
                 ACQUIRE_LOCK_ERR,
-                "Failed to acquire a lock due to a possible deadlock ["
-                        + "failedToAcquireLockTransactionId=" + failedToAcquireLockTxId
-                        + ", currentLockHolderTransactionId=" + currentLockHolderTxId
+                "Failed to acquire " + (abandonedLock ? "the abandoned " : "a ")
+                        + "lock due to a possible deadlock ["
+                        + "failedToAcquireLockTransactionId txn "

Review Comment:
   Fixed.



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/PossibleDeadlockOnLockAcquireException.java:
##########
@@ -32,18 +34,25 @@ public class PossibleDeadlockOnLockAcquireException extends LockException {
      * @param currentLockHolderTxId UUID of a transaction that currently holds the lock.
      * @param attemptedLockModeToAcquireWith {@link LockMode} that was tried to acquire the lock with but failed the attempt.
      * @param currentlyAcquiredLockMode {@link LockMode} of the lock that is already acquired with.
+     * @param abandonedLock flag which shows the status of the lock. If the state is uncertain, it's treated as abandoned.
+     * @param txStateMetaStorage txState required to properly log tx labels.
      */
     public PossibleDeadlockOnLockAcquireException(
             UUID failedToAcquireLockTxId,
             UUID currentLockHolderTxId,
             LockMode attemptedLockModeToAcquireWith,
-            LockMode currentlyAcquiredLockMode
+            LockMode currentlyAcquiredLockMode,
+            boolean abandonedLock,
+            VolatileTxStateMetaStorage txStateMetaStorage
     ) {
         super(
                 ACQUIRE_LOCK_ERR,
-                "Failed to acquire a lock due to a possible deadlock ["
-                        + "failedToAcquireLockTransactionId=" + failedToAcquireLockTxId
-                        + ", currentLockHolderTransactionId=" + currentLockHolderTxId
+                "Failed to acquire " + (abandonedLock ? "the abandoned " : "a ")
+                        + "lock due to a possible deadlock ["
+                        + "failedToAcquireLockTransactionId txn "
+                        + formatTxInfo(failedToAcquireLockTxId, txStateMetaStorage)
+                        + ", currentLockHolderTransactionId txn"

Review Comment:
   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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2730876911


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/DelayedAckException.java:
##########
@@ -31,13 +32,18 @@ public class DelayedAckException extends IgniteInternalException {
     private final UUID txId;
 
     /**
-     * Create the exception with txId and caus.
+     * Create the exception with txId, cause, and optional txManager for label formatting.
      *
      * @param txId The transaction id.
      * @param cause The cause.
+     * @param txManager Optional transaction manager to retrieve label for logging.

Review Comment:
   It used to be optional, it should stay like that, will just fix description



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2731337977


##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -1039,9 +1040,12 @@ public class IgniteImpl implements Ignite {
 
         resourcesRegistry = new RemotelyTriggeredResourceRegistry();
 
-        var transactionInflights = new TransactionInflights(placementDriverMgr.placementDriver(), clockService);
+        VolatileTxStateMetaStorage txStateVolatileStorage = new VolatileTxStateMetaStorage();
 
-        LockManager lockMgr = new HeapLockManager(systemConfiguration);
+        TransactionInflights transactionInflights =
+                new TransactionInflights(placementDriverMgr.placementDriver(), clockService, txStateVolatileStorage);
+
+        LockManager lockMgr = new HeapLockManager(systemConfiguration, txStateVolatileStorage);

Review Comment:
   Looks like a harmless change. Done.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "sk0x50 (via GitHub)" <gi...@apache.org>.
sk0x50 merged PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2731342313


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -152,7 +153,11 @@ private CompletableFuture<?> callCleanup(TxMeta txMeta, UUID txId) {
                 txMeta.commitTimestamp(),
                 txId
         ).exceptionally(throwable -> {
-            LOG.warn("Failed to cleanup transaction [txId={}].", throwable, txId);
+            LOG.warn(
+                    "Failed to cleanup transaction {}.",
+                    throwable,
+                    TransactionLogUtils.formatTxInfo(txId, txManager)

Review Comment:
   Done.



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2675769641


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -376,9 +384,12 @@ private static List<Lock> collectLocksFromStates(UUID txId, ConcurrentLinkedQueu
      * @param holder Lock holder.
      * @return Lock exception.
      */
-    private static LockException abandonedLockException(UUID locker, UUID holder) {
+    private static LockException abandonedLockException(UUID locker, UUID holder, VolatileTxStateMetaStorage storage) {
         return new LockException(ACQUIRE_LOCK_ERR,
-                "Failed to acquire an abandoned lock due to a possible deadlock [locker=" + locker + ", holder=" + holder + ']');
+                format(
+                        "Failed to acquire an abandoned lock due to a possible deadlock [locker={}, holder={}]",
+                        formatTxInfo(locker, storage), formatTxInfo(holder, storage)
+                ));

Review Comment:
   I would recommend replacing it with `PossibleDeadlockOnLockAcquireException`
   Also, please add tx label to all logs with `Failed to acquire a lock...`, I'd recommend to check every usage of `ACQUIRE_LOCK_ERR`. 
   
   Also, please pay attention to log that such formatting produces, it doesn't look good (should be something like objects in square brackets):
   `org.apache.ignite.internal.tx.LockException: IGN-TX-4 Failed to acquire an abandoned lock due to a possible deadlock [locker=txId=019ba26d-41e4-0000-0625-df6b00000001, holder=txId=019ba26d-41b7-0000-0625-df6b00000001] TraceId:6215d97a`



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2731340386


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java:
##########
@@ -553,7 +581,13 @@ private void performAddWriteWithCleanup(
             UUID wiTxId = result.currentWriteIntentTxId();
 
             if (lastCommitTs == null) {
-                throw new TxIdMismatchException(wiTxId, txId);
+
+                String formattedMessage = txManager != null ? format(
+                        "Mismatched transaction id [ expectedTxId={}, conflictingTxId= {}]",

Review Comment:
   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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2650906004


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -34,6 +34,7 @@
 import org.apache.ignite.internal.logger.IgniteLogger;

Review Comment:
   There are also log messages mentioned in the ticket but not changed here:
   - `Failed to acquire a lock`
   - `Transaction is already finished` (changed only in InternalTableImpl)
   
   This will require changes in HeapLockManager, ReadWriteTransactionImpl, InflightTransactionalOperationTracker, PartitionReplicaListener, maybe somewhere else.



##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -152,7 +153,7 @@ private CompletableFuture<?> callCleanup(TxMeta txMeta, UUID txId) {
                 txMeta.commitTimestamp(),
                 txId
         ).exceptionally(throwable -> {
-            LOG.warn("Failed to cleanup transaction [txId={}].", throwable, txId);
+            LOG.warn("Failed to cleanup transaction [{}].", throwable, TransactionLogUtils.formatTxInfo(txId, txManager));

Review Comment:
   it's better to use static method imports



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "denis-chudov (via GitHub)" <gi...@apache.org>.
denis-chudov commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2727609919


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/DelayedAckException.java:
##########
@@ -31,13 +32,18 @@ public class DelayedAckException extends IgniteInternalException {
     private final UUID txId;
 
     /**
-     * Create the exception with txId and caus.
+     * Create the exception with txId, cause, and optional txManager for label formatting.
      *
      * @param txId The transaction id.
      * @param cause The cause.
+     * @param txManager Optional transaction manager to retrieve label for logging.

Review Comment:
   Why "optional"? It's not `@Nullable` and mandatory if `txId` is not null. Let's make it truly optional



##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -1039,9 +1040,12 @@ public class IgniteImpl implements Ignite {
 
         resourcesRegistry = new RemotelyTriggeredResourceRegistry();
 
-        var transactionInflights = new TransactionInflights(placementDriverMgr.placementDriver(), clockService);
+        VolatileTxStateMetaStorage txStateVolatileStorage = new VolatileTxStateMetaStorage();
 
-        LockManager lockMgr = new HeapLockManager(systemConfiguration);
+        TransactionInflights transactionInflights =
+                new TransactionInflights(placementDriverMgr.placementDriver(), clockService, txStateVolatileStorage);
+
+        LockManager lockMgr = new HeapLockManager(systemConfiguration, txStateVolatileStorage);

Review Comment:
   lockMgr and txStateVolatileStorage are both started by tx manager in `TxManagerImpl#startAsync`. Tx state storage is passed to lock manager. 
   But in `TxManagerImpl#startAsync` first we start lock manager, and then tx state storage, so after the lock manager start, tx state storage is still not started. Maybe move tx state storage start before lock manager start? It shouldn't break anything as I see...



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/PossibleDeadlockOnLockAcquireException.java:
##########
@@ -32,18 +34,25 @@ public class PossibleDeadlockOnLockAcquireException extends LockException {
      * @param currentLockHolderTxId UUID of a transaction that currently holds the lock.
      * @param attemptedLockModeToAcquireWith {@link LockMode} that was tried to acquire the lock with but failed the attempt.
      * @param currentlyAcquiredLockMode {@link LockMode} of the lock that is already acquired with.
+     * @param abandonedLock flag which shows the status of the lock. If the state is uncertain, it's treated as abandoned.
+     * @param txStateMetaStorage txState required to properly log tx labels.
      */
     public PossibleDeadlockOnLockAcquireException(
             UUID failedToAcquireLockTxId,
             UUID currentLockHolderTxId,
             LockMode attemptedLockModeToAcquireWith,
-            LockMode currentlyAcquiredLockMode
+            LockMode currentlyAcquiredLockMode,
+            boolean abandonedLock,
+            VolatileTxStateMetaStorage txStateMetaStorage
     ) {
         super(
                 ACQUIRE_LOCK_ERR,
-                "Failed to acquire a lock due to a possible deadlock ["
-                        + "failedToAcquireLockTransactionId=" + failedToAcquireLockTxId
-                        + ", currentLockHolderTransactionId=" + currentLockHolderTxId
+                "Failed to acquire " + (abandonedLock ? "the abandoned " : "a ")
+                        + "lock due to a possible deadlock ["
+                        + "failedToAcquireLockTransactionId txn "
+                        + formatTxInfo(failedToAcquireLockTxId, txStateMetaStorage)
+                        + ", currentLockHolderTransactionId txn"

Review Comment:
   ```suggestion
                           + ", currentLockHolderTransactionId=txn"
   ```



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/PossibleDeadlockOnLockAcquireException.java:
##########
@@ -32,18 +34,25 @@ public class PossibleDeadlockOnLockAcquireException extends LockException {
      * @param currentLockHolderTxId UUID of a transaction that currently holds the lock.
      * @param attemptedLockModeToAcquireWith {@link LockMode} that was tried to acquire the lock with but failed the attempt.
      * @param currentlyAcquiredLockMode {@link LockMode} of the lock that is already acquired with.
+     * @param abandonedLock flag which shows the status of the lock. If the state is uncertain, it's treated as abandoned.
+     * @param txStateMetaStorage txState required to properly log tx labels.
      */
     public PossibleDeadlockOnLockAcquireException(
             UUID failedToAcquireLockTxId,
             UUID currentLockHolderTxId,
             LockMode attemptedLockModeToAcquireWith,
-            LockMode currentlyAcquiredLockMode
+            LockMode currentlyAcquiredLockMode,
+            boolean abandonedLock,
+            VolatileTxStateMetaStorage txStateMetaStorage
     ) {
         super(
                 ACQUIRE_LOCK_ERR,
-                "Failed to acquire a lock due to a possible deadlock ["
-                        + "failedToAcquireLockTransactionId=" + failedToAcquireLockTxId
-                        + ", currentLockHolderTransactionId=" + currentLockHolderTxId
+                "Failed to acquire " + (abandonedLock ? "the abandoned " : "a ")
+                        + "lock due to a possible deadlock ["
+                        + "failedToAcquireLockTransactionId txn "

Review Comment:
   ```suggestion
                           + "failedToAcquireLockTransactionId=txn "
   ```



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java:
##########
@@ -553,7 +581,13 @@ private void performAddWriteWithCleanup(
             UUID wiTxId = result.currentWriteIntentTxId();
 
             if (lastCommitTs == null) {
-                throw new TxIdMismatchException(wiTxId, txId);
+
+                String formattedMessage = txManager != null ? format(
+                        "Mismatched transaction id [ expectedTxId={}, conflictingTxId= {}]",

Review Comment:
   ```suggestion
                           "Mismatched transaction id [expectedTxId={}, conflictingTxId={}]",
   ```



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -866,15 +858,24 @@ private boolean isWaiterReadyToNotify(WaiterImpl waiter, boolean skipFail) {
 
                 if (currentlyAcquiredLockMode != null && !currentlyAcquiredLockMode.isCompatible(intendedLockMode)) {
                     if (conflictFound(waiter.txId())) {
-                        waiter.fail(abandonedLockException(waiter.txId, tmp.txId));
+                        waiter.fail(new PossibleDeadlockOnLockAcquireException(

Review Comment:
   Let's add comment that abandoned lock exception is thrown here 



##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -892,15 +893,23 @@ private boolean isWaiterReadyToNotify(WaiterImpl waiter, boolean skipFail) {
                     if (skipFail) {
                         return false;
                     } else if (conflictFound(waiter.txId())) {
-                        waiter.fail(abandonedLockException(waiter.txId, tmp.txId));
-
+                        waiter.fail(new PossibleDeadlockOnLockAcquireException(
+                                waiter.txId,
+                                tmp.txId,
+                                intendedLockMode,
+                                currentlyAcquiredLockMode,
+                                true,

Review Comment:
   and here



##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -152,7 +153,11 @@ private CompletableFuture<?> callCleanup(TxMeta txMeta, UUID txId) {
                 txMeta.commitTimestamp(),
                 txId
         ).exceptionally(throwable -> {
-            LOG.warn("Failed to cleanup transaction [txId={}].", throwable, txId);
+            LOG.warn(
+                    "Failed to cleanup transaction {}.",
+                    throwable,
+                    TransactionLogUtils.formatTxInfo(txId, txManager)

Review Comment:
   you can use method static import



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2730830041


##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java:
##########
@@ -376,9 +384,12 @@ private static List<Lock> collectLocksFromStates(UUID txId, ConcurrentLinkedQueu
      * @param holder Lock holder.
      * @return Lock exception.
      */
-    private static LockException abandonedLockException(UUID locker, UUID holder) {
+    private static LockException abandonedLockException(UUID locker, UUID holder, VolatileTxStateMetaStorage storage) {
         return new LockException(ACQUIRE_LOCK_ERR,
-                "Failed to acquire an abandoned lock due to a possible deadlock [locker=" + locker + ", holder=" + holder + ']');
+                format(
+                        "Failed to acquire an abandoned lock due to a possible deadlock [locker={}, holder={}]",
+                        formatTxInfo(locker, storage), formatTxInfo(holder, storage)
+                ));

Review Comment:
   Done



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-27003 Log messages containing tx id, should also contain label [ignite-3]

Posted by "Lalant (via GitHub)" <gi...@apache.org>.
Lalant commented on code in PR #7304:
URL: https://github.com/apache/ignite-3/pull/7304#discussion_r2730828663


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/handlers/TxCleanupRecoveryRequestHandler.java:
##########
@@ -34,6 +34,7 @@
 import org.apache.ignite.internal.logger.IgniteLogger;

Review Comment:
   Done



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org