ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-7377 Correctly re-create cache entry for tx entry
Date Thu, 11 Jan 2018 10:15:16 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 2de75fd45 -> ba9c11041


ignite-7377 Correctly re-create cache entry for tx entry


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ba9c1104
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ba9c1104
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ba9c1104

Branch: refs/heads/master
Commit: ba9c11041c9a2659340d1dbb34b075f2e306c815
Parents: 2de75fd
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jan 11 13:15:07 2018 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jan 11 13:15:07 2018 +0300

----------------------------------------------------------------------
 .../cache/transactions/IgniteTxManager.java     | 29 +++++++++++++++++++-
 .../util/tostring/GridToStringBuilder.java      |  3 ++
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ba9c1104/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 77634bd..a9353f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -1610,7 +1610,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
                             if (txEntry2 == txEntry1)
                                 break;
 
-                            txEntry2.cached().txUnlock(tx);
+                            txUnlock(tx, txEntry2);
                         }
 
                         return false;
@@ -1648,6 +1648,33 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter
{
     }
 
     /**
+     * @param tx Transaction.
+     * @param txEntry Entry to unlock.
+     */
+    private void txUnlock(IgniteInternalTx tx, IgniteTxEntry txEntry) {
+        while (true) {
+            try {
+                txEntry.cached().txUnlock(tx);
+
+                break;
+            }
+            catch (GridCacheEntryRemovedException ignored) {
+                if (log.isDebugEnabled())
+                    log.debug("Got removed entry in TM txUnlock(..) method (will retry):
" + txEntry);
+
+                try {
+                    txEntry.cached(txEntry.context().cache().entryEx(txEntry.key(), tx.topologyVersion()));
+                }
+                catch (GridDhtInvalidPartitionException e) {
+                    tx.addInvalidPartition(txEntry.context(), e.partition());
+
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
      * @param tx Owning transaction.
      * @param entries Entries to unlock.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ba9c1104/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
index ab3bb75..e633ded 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java
@@ -1048,6 +1048,9 @@ public class GridToStringBuilder {
      */
     @SuppressWarnings({"ConstantConditions", "unchecked"})
     public static <T> String arrayToString(Class arrType, Object arr) {
+        if (arr == null)
+            return "null";
+
         T[] array = (T[])arr;
 
         if (array.length > COLLECTION_LIMIT)


Mime
View raw message