Skip to content

Commit

Permalink
GG-24762 Faster transaction rolled back when one of backup node failed
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkalenko committed Nov 21, 2019
1 parent 0125ae4 commit cc3f618
Show file tree
Hide file tree
Showing 3 changed files with 403 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteUuid;

import static java.util.Objects.isNull;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
import static org.apache.ignite.internal.processors.cache.GridCacheOperation.CREATE;
Expand Down Expand Up @@ -485,18 +486,26 @@ private boolean finish(boolean commit,
req.writeVersion(tx.writeVersion() != null ? tx.writeVersion() : tx.xidVersion());

try {
cctx.io().send(n, req, tx.ioPolicy());
if (isNull(cctx.discovery().getAlive(n.id()))) {
log.error("Unable to send message (node left topology): " + n);

if (msgLog.isDebugEnabled()) {
msgLog.debug("DHT finish fut, sent request dht [txId=" + tx.nearXidVersion() +
", dhtTxId=" + tx.xidVersion() +
", node=" + n.id() + ']');
fut.onNodeLeft(new ClusterTopologyCheckedException("Node left grid while sending message to: "
+ n.id()));
}
else {
cctx.io().send(n, req, tx.ioPolicy());

if (sync)
res = true;
else
fut.onDone();
if (msgLog.isDebugEnabled()) {
msgLog.debug("DHT finish fut, sent request dht [txId=" + tx.nearXidVersion() +
", dhtTxId=" + tx.xidVersion() +
", node=" + n.id() + ']');
}

if (sync)
res = true;
else
fut.onDone();
}
}
catch (IgniteCheckedException e) {
// Fail the whole thing.
Expand Down

0 comments on commit cc3f618

Please sign in to comment.