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 <[email protected]> Authored: Fri Dec 22 11:52:45 2017 +0300 Committer: sboikov <[email protected]> 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} */
