You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/12/25 11:46:37 UTC
[05/20] ignite git commit: IGNITE-6015: Rollback on exception in
commitIfLocked.
IGNITE-6015: Rollback on exception in commitIfLocked.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9f98ca19
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9f98ca19
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9f98ca19
Branch: refs/heads/ignite-zk
Commit: 9f98ca19980365223e892b4748e8861d73a728b4
Parents: 6c02694
Author: Andrey Kuznetsov <st...@gmail.com>
Authored: Fri Dec 22 11:52:45 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Dec 22 11:52:45 2017 +0300
----------------------------------------------------------------------
.../GridDistributedTxRemoteAdapter.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/9f98ca19/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 7a10c10..f84fb99 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -324,18 +324,24 @@ public abstract class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
/** {@inheritDoc} */
@Override public boolean onOwnerChanged(GridCacheEntryEx entry, GridCacheMvccCandidate owner) {
+ if (!hasWriteKey(entry.txKey()))
+ return false;
+
try {
- if (hasWriteKey(entry.txKey())) {
- commitIfLocked();
+ commitIfLocked();
- return true;
- }
+ return true;
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to commit remote transaction: " + this, e);
- }
- return false;
+ invalidate(true);
+ systemInvalidate(true);
+
+ rollbackRemoteTx();
+
+ return false;
+ }
}
/** {@inheritDoc} */